43 int n = MultiByteToWideChar(CP_UTF8, 0, utf8, -1, NULL, 0);
44 WCHAR *ucs16 =
gc_malloc(n *
sizeof(WCHAR),
false,
gc);
45 MultiByteToWideChar(CP_UTF8, 0, utf8, -1, ucs16, n);
53 int n = WideCharToMultiByte(CP_UTF8, 0, utf16, -1, NULL, 0, NULL, NULL);
59 WideCharToMultiByte(CP_UTF8, 0, utf16, -1, utf8, n, NULL, NULL);
77 cmp_prefix(
const char *str,
const bool n,
const char *pre)
88 const int c1 = pre[i];
104 return c2 ==
'\0' || c2 ==
'.';
110 if (c1 != tolower(c2))
154 static char tmpdir[MAX_PATH];
155 WCHAR wtmpdir[MAX_PATH];
157 if (!GetTempPathW(_countof(wtmpdir), wtmpdir))
162 if (WideCharToMultiByte(CP_UTF8, 0, wtmpdir, -1, NULL, 0, NULL, NULL) >
sizeof(tmpdir))
164 msg(
M_WARN,
"Could not get temporary directory. Path is too long."
165 " Consider using --tmp-dir");
169 WideCharToMultiByte(CP_UTF8, 0, wtmpdir, -1, tmpdir,
sizeof(tmpdir), NULL, NULL);