[Greasemonkey] Charset problems (nsIScriptableUnicodeConverter)

Nikolas Coukouma lists at atrus.org
Thu Aug 4 21:30:58 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If you are getting errors like the following:

Error : uncaught exception: [Exception... "Component returned failure
code:
0x80004005 (NS_ERROR_FAILURE)
[nsIScriptableUnicodeConverter.ConvertToUnicode]" nsresult: "0x80004005
(NS_ERROR_FAILURE)" location: "JS frame ::
chrome://greasemonkey/content/utils.js :: getContents :: line 160"
data:no]

The problem is simple:
Your script is in one of the many single-byte character sets floating
around that "extend" ASCII; they often cause the conversion to a
unicode string to fail because GM assumes your script is in UTF-8
(when it isn't). One simple solution is to remove characters that
aren't in ascii (accented characters and symbols are usually a
problem). Another option is to convert the file to UTF-8, which is
what 0.5 is expecting.

Most good text editors can do this, but I've also made a little web
service to help:
http://hacks.atrus.org/charset-convert/

Bugzilla bug:
http://bugzilla.mozdev.org/show_bug.cgi?id=11123

This will be fixed in the next release.

- -Nikolas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFC8rNCs2zR4YuWmeERAuYVAJ9JJbJDDesMVnlKBpaiq6pUBUXrjgCfW+iI
aFAPBTtg1curIEqWRXLt2lc=
=RMCc
-----END PGP SIGNATURE-----



More information about the Greasemonkey mailing list