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 690716 - Impossible to meaningfully import modules with non-Latin1 strings
Impossible to meaningfully import modules with non-Latin1 strings
Status: RESOLVED DUPLICATE of bug 687095
Product: gjs
Classification: Bindings
Component: general
1.34.x
Other Linux
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2012-12-25 17:28 UTC by Paul Pogonyshev
Modified: 2012-12-25 17:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Paul Pogonyshev 2012-12-25 17:28:34 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.
Comment 1 Giovanni Campagna 2012-12-25 17:47:12 UTC
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 ***