I am writing a fairly simple extension for Chrome. The main graphical body of it (the part dealing with html, i.e. the front-end) works fine, but when I try to include a second JavaScript file that uses Jquery's $.ajax() function to return some info from another page to the front-end, Chrome throws the following error and won't let me load the extension:
Could not load extension from "Path\to\extension". Could not load file "filename.js" for content script. It isn't UTF-8 encoded.
I don't honestly know enough about UTF-8 encoding to be able to tell what would make Chrome say that about my file. I have no special characters, no accent marks or anything, which i know can screw things up. I haven't been able to find a good solution anywhere, either.
Bookmark this question. Show activity on this post. Apparently Google's encoding is UTF-8 as it's stated in it's html meta tag.
Select "View" from the top of your browser window. Select "Text Encoding." Select "Unicode (UTF-8)" from the dropdown menu.
In other words, the character encoding translates the Unicode code points to unique code unit sequences. Popular encodings are UTF-8, UTF-16 and UTF-32. Most JavaScript engines use UTF-16 encoding, so let's detail into UTF-16.
An easy way to UTF-8 encode your files, is to use an editor that allows you to choose that encoding. If you can't do that, there are (fairly standard) tools on linux/unix system to check (file) and to change (iconv, recode) the encoding. If you use Windows, such tools can be installed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With