GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

Commit aa93ab21 authored by Philip Chimento's avatar Philip Chimento 🚮

Merge branch 'master' into 'master'

Fix ARGV encoding issues.

Closes #22

See merge request !108
parents 0cab726f 67f949fa
Pipeline #9035 passed with stages
in 37 minutes and 1 second
......@@ -279,6 +279,7 @@ AM_TESTS_ENVIRONMENT = \
export G_FILENAME_ENCODING=latin1; \
export LSAN_OPTIONS="suppressions=$(abs_top_srcdir)/installed-tests/extra/lsan.supp"; \
export NO_AT_BRIDGE=1; \
export LC_ALL=C.UTF-8; \
$(COVERAGE_TESTS_ENVIRONMENT) \
$(XVFB_START) \
$(DBUS_SESSION_COMMAND) \
......
......@@ -313,8 +313,9 @@ gjs_build_string_array(JSContext *context,
g_error("Unable to reserve memory for vector");
for (i = 0; i < array_length; ++i) {
JS::ConstUTF8CharsZ chars(array_values[i], strlen(array_values[i]));
JS::RootedValue element(context,
JS::StringValue(JS_NewStringCopyZ(context, array_values[i])));
JS::StringValue(JS_NewStringCopyUTF8Z(context, chars)));
if (!elems.append(element))
g_error("Unable to append to vector");
}
......
......@@ -99,6 +99,12 @@ else
skip "System.exit() should still exit across an FFI boundary" "running under valgrind"
fi
# ensure the encoding of argv is being properly handled
$gjs -c 'imports.system.exit((ARGV[0] !== "Valentín") ? 1 : 0)' "Valentín"
report "Basic unicode encoding (accents, etc) should be functioning properly for ARGV and imports."
$gjs -c 'imports.system.exit((ARGV[0] !== "☭") ? 1 : 0)' "☭"
report "Unicode encoding for symbols should be functioning properly for ARGV and imports."
# gjs --help prints GJS help
$gjs --help >/dev/null
report "--help should succeed"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment