-
-/*
- * Strings on the US heap are encoded using UTF-16. Poor man's
- * UTF-16 to UTF-8. I know its broken, use libunicode later.
- */
-static char *
-get_encoded_user_string (const char *ptr)
-{
- char *res, *result;
- int len, i, j;
-
- len = mono_metadata_decode_blob_size (ptr, &ptr);
- res = g_malloc (len + 1);
-
- /*
- * I should really use some kind of libunicode here
- */
- for (i = 0, j = 0; i < len; j++, i += 2)
- res [j] = ptr [i];
-
- res [j] = 0;
-
- result = g_strescape (res, NULL);
- g_free (res);
-
- return result;
-}