Minor Unicode fixes

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6345 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2013-04-11 20:54:29 +00:00
parent eaa6991b91
commit e8ac52b908
3 changed files with 8 additions and 6 deletions

View file

@ -36,11 +36,13 @@ UINT StrLenUTF16(const void*str)
bool StrSetUTF16LE(tstring&dest, const void*src)
{
#ifdef _WIN32
dest = (wchar_t*) src;
#else
#error TODO: UTF16LE to wchar_t
#ifndef _WIN32
CharEncConv cec;
if (!cec.Initialize(-1,NStreamEncoding::UTF16LE)) return false;
src = (const void*) cec.Convert(src);
if (!src) return false;
#endif
try { dest = (wchar_t*) src; } catch(...) { return false; }
return true;
}