From 4bfbb120df998a6f7d52421a17fed055c89811e0 Mon Sep 17 00:00:00 2001 From: spx Date: Thu, 30 Jun 2011 09:04:49 +0000 Subject: [PATCH] WebParser: Added support code for CodePage=1200(UTF-16LE). --- Plugins/PluginWebParser/WebParser.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Plugins/PluginWebParser/WebParser.cpp b/Plugins/PluginWebParser/WebParser.cpp index c6c30963..d4cbba55 100644 --- a/Plugins/PluginWebParser/WebParser.cpp +++ b/Plugins/PluginWebParser/WebParser.cpp @@ -871,7 +871,13 @@ void ParseData(UrlData* urlData, LPCSTR parseData) // Compilation succeeded: match the subject in the second argument std::string utf8Data; - if (urlData->codepage != CP_UTF8 && urlData->codepage != 0) // 0 = CP_ACP + if (urlData->codepage == 1200) // 1200 = UTF-16LE + { + // Must convert the data to utf8 + utf8Data = ConvertWideToUTF8((LPCWSTR)parseData); + parseData = utf8Data.c_str(); + } + else if (urlData->codepage != CP_UTF8 && urlData->codepage != 0) // 0 = CP_ACP { // Must convert the data to utf8 utf8Data = ConvertAsciiToUTF8(parseData, urlData->codepage);