diff --git a/gjs/context.c b/gjs/context.c
index eee03fe..66631a1 100644
--- a/gjs/context.c
+++ b/gjs/context.c
@@ -435,6 +435,7 @@ gjs_context_constructor (GType                  type,
     js_context = GJS_CONTEXT(object);
 
     if (js_context->runtime == NULL) {
+        JS_SetCStringsAreUTF8();
         js_context->runtime = JS_NewRuntime(32*1024*1024 /* max bytes */);
         if (js_context->runtime == NULL)
             gjs_fatal("Failed to create javascript runtime");
diff --git a/gjs/jsapi-util-array.c b/gjs/jsapi-util-array.c
index d3ce3f7..3c6e23c 100644
--- a/gjs/jsapi-util-array.c
+++ b/gjs/jsapi-util-array.c
@@ -300,6 +300,7 @@ gjstest_test_func_gjs_jsapi_util_array(void)
     int i;
     jsval value;
 
+    JS_SetCStringsAreUTF8();
     runtime = JS_NewRuntime(1024*1024 /* max bytes */);
     context = JS_NewContext(runtime, 8192);
     global = JS_NewObject(context, NULL, NULL, NULL);
diff --git a/gjs/jsapi-util-error.c b/gjs/jsapi-util-error.c
index 2e1e58c..e8794e2 100644
--- a/gjs/jsapi-util-error.c
+++ b/gjs/jsapi-util-error.c
@@ -213,6 +213,7 @@ gjstest_test_func_gjs_jsapi_util_error_throw(void)
     /* create a runtime just to avoid tangling this test with all the
      * code surrounding how we create one normally in context.c
      */
+    JS_SetCStringsAreUTF8();
     runtime = JS_NewRuntime(1024*1024 /* max bytes */);
     context = JS_NewContext(runtime, 8192);
     global = JS_NewObject(context, NULL, NULL, NULL);
diff --git a/gjs/jsapi-util-string.c b/gjs/jsapi-util-string.c
index 2e953c8..6a3d1b2 100644
--- a/gjs/jsapi-util-string.c
+++ b/gjs/jsapi-util-string.c
@@ -436,6 +436,7 @@ gjstest_test_func_gjs_jsapi_util_string_js_string_utf8(void)
     JSObject *global;
     jsval js_string;
 
+    JS_SetCStringsAreUTF8();
     runtime = JS_NewRuntime(1024*1024 /* max bytes */);
     context = JS_NewContext(runtime, 8192);
     global = JS_NewObject(context, NULL, NULL, NULL);
@@ -467,6 +468,7 @@ gjstest_test_func_gjs_jsapi_util_string_get_ascii(void)
     JSString  *js_string;
     jsval      void_value;
 
+    JS_SetCStringsAreUTF8();
     runtime = JS_NewRuntime(1024*1024 /* max bytes */);
     context = JS_NewContext(runtime, 8192);
     global = JS_NewObject(context, NULL, NULL, NULL);
@@ -501,6 +503,7 @@ gjstest_test_func_gjs_jsapi_util_string_get_binary(void)
     g_assert_cmpuint(sizeof(binary_string), ==, 12);
     g_assert_cmpuint(sizeof(binary_string_odd), ==, 15);
 
+    JS_SetCStringsAreUTF8();
     runtime = JS_NewRuntime(1024*1024 /* max bytes */);
     context = JS_NewContext(runtime, 8192);
     global = JS_NewObject(context, NULL, NULL, NULL);
