use gunichar2
authorEgor Bogatov <egorbo@gmail.com>
Tue, 27 Aug 2019 17:21:51 +0000 (20:21 +0300)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Tue, 27 Aug 2019 18:21:39 +0000 (20:21 +0200)
Commit migrated from https://github.com/mono/mono/commit/e9dff75d2fb049f11fdcf595b68de1f3061bdeb7

src/mono/mono/metadata/appdomain.c

index 43a394c..bec93bb 100644 (file)
@@ -97,8 +97,8 @@ static gboolean no_exec = FALSE;
 
 #ifdef ENABLE_NETCORE
 static int n_appctx_props;
-static char **appctx_keys;
-static char **appctx_values;
+static gunichar2 **appctx_keys;
+static gunichar2 **appctx_values;
 #endif
 
 static const char *
@@ -3336,12 +3336,12 @@ void
 mono_runtime_register_appctx_properties (int nprops, const char **keys,  const char **values)
 {
        n_appctx_props = nprops;
-       appctx_keys = g_new0 (char*, nprops);
-       appctx_values = g_new0 (char*, nprops);
+       appctx_keys = g_new0 (gunichar2*, nprops);
+       appctx_values = g_new0 (gunichar2*, nprops);
 
        for (int i = 0; i < nprops; ++i) {
-               appctx_keys [i] = g_strdup (keys [i]);
-               appctx_values [i] = g_strdup (values [i]);
+               appctx_keys [i] = g_utf8_to_utf16 (keys [i], strlen (keys [i]), NULL, NULL, NULL);
+               appctx_values [i] = g_utf8_to_utf16 (values [i], strlen (values [i]), NULL, NULL, NULL);
        }
 }