GNOME Bugzilla – Bug 687095
Wrong encoding of imported js file
Last modified: 2012-12-25 17:47:12 UTC
Created attachment 227512 [details] encoding.js First try to run encoding.js on its own: - gjs ./encoding.js - "15 °C" is properly displayed, all good Now try running bug.js which will just import encoding.js - GJS_PATH=$(pwd) gjs ./bug.js - "15 °C" is displayed so the encoding of the string has been changed during the import.
Created attachment 227513 [details] bug.js
Created attachment 227569 [details] [review] Convert imported modules from UTF-8 to UTF-16 before executing If JS_CStringsAreUTF8 is false, the JSAPI assumes C strings are ISO-8859-1. Unfortunately, we rely on that setting for byte arrays, so just do the conversion ourselves, like we do in gjs_context_eval().
Review of attachment 227569 [details] [review]: Sure.
This patche fixes my bug, thanks a lot!
Attachment 227569 [details] pushed as c614834 - Convert imported modules from UTF-8 to UTF-16 before executing
*** Bug 690716 has been marked as a duplicate of this bug. ***