On Wed, 24 Nov 2010 22:57:57 +0100
Marek Kubica <[email protected]> wrote:
> Your code works in Seed just fine, but interestingly, it fails so in
> Gjs, because "Error: Failed to convert UTF-8 string to JS string:
> Invalid byte sequence in conversion input"
Oh, wait, I didn't test enough:
Gio = imports.gi.Gio;
GLib = imports.gi.GLib;
function construct_dict(filename) {
var f = GLib.file_get_contents(filename);
print(f);
print(f.content);
}
construct_dict("abc");
where abc is a trivial file returns
true,This is a test
this too
,24
undefined
in Gjs (= works)
and
1
[undefined]
in Seed (= does not work)
Once I try my "real" log file, Gjs fails with "Error: Failed to convert
UTF-8 string to JS string: Invalid byte sequence in conversion input"
and Seed just keeps on doing nothing.
Versions: Seed 2.31.91, Gjs 0.7.7, gobject-introspection 0.9.12, glib
2.26.1
Any idea why Gjs fails to read my file?
regards,
Marek
_______________________________________________
javascript-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/javascript-list