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

@ -8,7 +8,7 @@ These commands are similar to the C preprocessor in terms of purpose and functio
\# NOTE: \NsisInputCharset define cannot be used in a \c block
\c [/NONFATAL] [/CHARSET=ACP|OEM|CP#|UTF8|UTF16LE] file
\c [/NONFATAL] [/CHARSET=ACP|OEM|CP#|UTF8|UTF16LE|UTF16BE] file
This command will include 'file' as if it was part of the original script. Note that if a file is included in another directory, the current directory is still where the script was compiled from (not where the included file resides). If the compiler can't find the file it will look for it in every include directory. See \R{addincludedir}{!addincludedir} for more information. If the /nonfatal switch is used and no files are found, a warning will be issued instead of an error. /charset can be used to specify a codepage for plain text files without a BOM.

View file

@ -12,7 +12,7 @@
\define{NsisACPcp} system default ANSI codepage (ACP)
\define{NsisInputCharset} ACP|OEM|CP#|UTF8|UTF16LE
\define{NsisInputCharset} ACP|OEM|CP#|UTF8|UTF16LE|UTF16BE
\define{NsisWarnBlockContainerBegin} \\<div class=\\"wb\\"\\>

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;
}