GNOME Bugzilla – Bug 690716
Impossible to meaningfully import modules with non-Latin1 strings
Last modified: 2012-12-25 17:47:12 UTC
I believe this is related, but not quite the same as long-standing bug #599860. Short explanation: print("ФЫВА") from gjs console or first module (test.js for $ gjs test.js) works as expected, from any imported module it produces garbled output. Simple test case. File 'test.js': print ("ФЫВА"); imports.searchPath.push ('.'); imports.test2.foo (); File 'test2.js': function foo () { print ("ФЫВА"); } Run as $ gjs test.js. Output: ФЫВА ФЫÐÐ I believe this could be resolved in file 'gjs/importer.c' if after this code: if (!g_file_get_contents(full_path, &script, &script_len, NULL)) { return NULL; } some decoding for 'script' buffer is added. As it stands, the buffer (raw bytes read from file) are passed to SpiderMonkey, which itself doesn't try any recoding.
Thanks for taking the time to report this bug. This particular bug has already been reported into our bug tracking system, but we are happy to tell you that the problem has already been fixed. It should be solved in the next software version. You may want to check for a software upgrade. *** This bug has been marked as a duplicate of bug 687095 ***