After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 581028 - gjs thinks its input is in iso8859-1 or something
gjs thinks its input is in iso8859-1 or something
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2009-05-01 17:17 UTC by Dan Winship
Modified: 2011-06-06 15:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
parse input as utf-8 (4.80 KB, patch)
2011-06-04 17:14 UTC, Colin Walters
committed Details | Review

Description Dan Winship 2009-05-01 17:17:34 UTC
gjs> log("«")
      JS LOG: «

likewise with input source files. It should assume UTF-8
Comment 1 Havoc Pennington 2009-05-01 17:24:51 UTC
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.
Comment 2 Owen Taylor 2009-05-01 17:42:56 UTC
Another alternative: convert from UTF-8 ourselves and use JS_EvaluateUCScript()
Comment 3 Havoc Pennington 2009-05-01 18:24:30 UTC
ah, yes that sounds easier ;-)
Comment 4 Colin Walters 2011-06-04 17:14:31 UTC
Created attachment 189224 [details] [review]
parse input as utf-8
Comment 5 Johan (not receiving bugmail) Dahlin 2011-06-06 14:03:14 UTC
(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.