From 62dd54c8c2ea801970b42a36926eb5c3f7faf666 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Mal=C3=BD?= Date: Wed, 10 Feb 2016 20:47:06 +0100 Subject: [PATCH] Fix ISO-8859-1 to UTF-8 conversion on Windows --- libhpcs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.43.5