I am trying to set charset="utf-8" inside the javascript file itself, not in the script tag, I know that I can do this:
<script type="text/javascript" charset="UTF-8" src="xyz.js"></script>
But unfortunately, this solution needs me to do the same step with hundreds of websites which are using the same script. so I am trying to set the charset in the javascript file itself. Is this possible?
thanks
utf-8
encoding when you create the file. Really not clear what higher level problem you are trying to solve – Jehiuscharset="UTF-8"
in the<script>
tag of the HTML file. Otherwise, most browsers will decode the JS file as ISO 8859-1, which does not include Arabic characters. And you have to do this in every HTML file that references this JS file, there's no other mechanism to let the browser know the encoding of the JS file, as far as I know. – Duckweed