- for (i = 0; i < num; ++i) {
- (*ret)[i] = g_locale_to_utf8(p, -1, NULL, NULL, NULL);
+ while (p < raw + num - 1) {
+ ++count;
+ strs = g_slist_append(strs, p);
+ p += strlen(p) + 1; /* next string */
+ }
+
+ *ret = g_new0(char*, count + 1);
+ (*ret)[count] = NULL; /* null terminated list */
+
+ for (i = 0, it = strs; it; ++i, it = g_slist_next(it)) {
+ (*ret)[i] = g_convert(it->data, -1, "UTF-8", "ISO-8859-1",
+ NULL, NULL, NULL);