27 #if defined(USE_WIN32_IDN) || ((defined(USE_WINDOWS_SSPI) || \ 28 defined(USE_WIN32_LDAP)) && defined(UNICODE)) 40 wchar_t *Curl_convert_UTF8_to_wchar(
const char *str_utf8)
42 wchar_t *str_w = NULL;
45 int str_w_len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS,
46 str_utf8, -1, NULL, 0);
48 str_w =
malloc(str_w_len *
sizeof(
wchar_t));
50 if(MultiByteToWideChar(CP_UTF8, 0, str_utf8, -1, str_w,
62 char *Curl_convert_wchar_to_UTF8(
const wchar_t *str_w)
64 char *str_utf8 = NULL;
67 int str_utf8_len = WideCharToMultiByte(CP_UTF8, 0, str_w, -1, NULL,
69 if(str_utf8_len > 0) {
70 str_utf8 =
malloc(str_utf8_len *
sizeof(
wchar_t));
72 if(WideCharToMultiByte(CP_UTF8, 0, str_w, -1, str_utf8, str_utf8_len,