[Greasemonkey] Character encoding issues with GM_setValue

Nikolas Coukouma lists at atrus.org
Fri Jun 3 08:40:40 EDT 2005


Mark Pilgrim wrote:

>One of the scripts I'm working on downloads RSS/Atom feeds and caches
>them with GM_setValue.  Downloading them works OK (i.e. parsing the
>responseText with DOMParser produces the correct DOM tree of the
>feed), but when I read them back with GM_getValue I get
>"non-wellformed XML" errors.  I suspect that the issue is one of
>character encoding; the values stored in the Firefox preferences
>database don't handle character encoding properly.  Is this a known
>issue, and if so, is it fixable within GM or is there a workaround I
>could try?
>
>I get the same results storing things like document.title with
>GM_setValue; if the title contains high-bit characters (example:
>http://tbray.org/ongoing/ ) then the value gets munged when it's
>stored.  about:config shows the raw value as terminating at the first
>high-bit character.
>  
>
I've tested it and it seems to get garbled both ways. Opened a bug:
http://www.mozdev.org/bugs/show_bug.cgi?id=10543

-Nikolas Coukouma


More information about the Greasemonkey mailing list