- if (wimlib_mbs_is_utf8) {
- *utf8_ret = (xmlChar *)tstr;
- return 0;
- }
- return tstr_to_utf8_simple(tstr, (char **)utf8_ret);
+#if TCHAR_IS_UTF16LE
+ return utf16le_to_utf8(tstr, tstrlen(tstr) * sizeof(tchar),
+ (char **)utf8_ret, NULL);
+#else
+ *utf8_ret = (const xmlChar *)tstr;
+ return 0;
+#endif