GNOME Bugzilla – Bug 581028
gjs thinks its input is in iso8859-1 or something
Last modified: 2011-06-06 15:43:00 UTC
gjs> log("«") JS LOG: « likewise with input source files. It should assume UTF-8
Looks like JS_EvaluateScript is broken unless JS_CStringsAreUTF8(). But if JS_CStringsAreUTF8() the binary string stuff in jsapi-util-string.c breaks. I guess the fix would be to add a ByteArray type (there's another bug open for that) and then set CStringsAreUTF8 mode.
Another alternative: convert from UTF-8 ourselves and use JS_EvaluateUCScript()
ah, yes that sounds easier ;-)
Created attachment 189224 [details] [review] parse input as utf-8
(In reply to comment #4) > Created an attachment (id=189224) [details] [review] > parse input as utf-8 This makes a lot of sense, but it should probably be documented somewhere to avoid surprises. Especially in release notes etc, since this will break code existing code. Patch looks good, as long as it doesn't introduce leaks etc.