From: Michal MalĂ˝ Date: Wed, 10 Feb 2016 19:47:06 +0000 (+0100) Subject: Fix ISO-8859-1 to UTF-8 conversion on Windows X-Git-Url: https://gitweb.devoid-pointer.net/?a=commitdiff_plain;h=62dd54c8c2ea801970b42a36926eb5c3f7faf666;p=libHPCS.git Fix ISO-8859-1 to UTF-8 conversion on Windows --- diff --git a/libhpcs.c b/libhpcs.c index 7a48a92..5e0dd59 100644 --- a/libhpcs.c +++ b/libhpcs.c @@ -1261,7 +1261,7 @@ static enum HPCS_ParseCode __win32_latin1_to_utf8(char** target, const char *s) wchar_t* intermediate; size_t mb_size; - size_t w_size = MultiByteToWideChar(28591, MB_COMPOSITE, s, -1, NULL, 0); + size_t w_size = MultiByteToWideChar(28591, 0, s, -1, NULL, 0); if (w_size == 0) { PR_DEBUGF("Count MultiByteToWideChar() error 0x%x\n", GetLastError()); return PARSE_E_INTERNAL; @@ -1272,7 +1272,7 @@ static enum HPCS_ParseCode __win32_latin1_to_utf8(char** target, const char *s) if (intermediate == NULL) return PARSE_E_NO_MEM; - if (MultiByteToWideChar(28591, MB_COMPOSITE, s, -1, intermediate, 0) == 0) { + if (MultiByteToWideChar(28591, 0, s, -1, intermediate, w_size) == 0) { PR_DEBUGF("Convert MultiByteToWideChar() error 0x%x\n", GetLastError()); return PARSE_E_INTERNAL; }