CreateUnicodeString -> winchar_fromansi
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4888 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
249903acc8
commit
01ebc199ef
1 changed files with 1 additions and 14 deletions
|
@ -217,24 +217,11 @@ bool CResourceEditor::UpdateResourceW(WCHAR* szType, WCHAR* szName, LANGID wLang
|
|||
return true;
|
||||
}
|
||||
|
||||
static WCHAR* CreateUnicodeString(const char* szString) {
|
||||
int iLen = MultiByteToWideChar(CP_ACP, 0, szString, -1, 0, 0);
|
||||
if (iLen == 0)
|
||||
throw runtime_error("Unicode conversion failed");
|
||||
|
||||
WCHAR* szwString = new WCHAR[iLen + 1];
|
||||
|
||||
if (MultiByteToWideChar(CP_ACP, 0, szString, -1, szwString, iLen + 1) == 0)
|
||||
throw runtime_error("Unicode conversion failed");
|
||||
|
||||
return szwString;
|
||||
}
|
||||
|
||||
static WCHAR* ResStringToUnicode(const char *szString) {
|
||||
if (IS_INTRESOURCE(szString))
|
||||
return MAKEINTRESOURCEW(szString);
|
||||
else
|
||||
return CreateUnicodeString(szString);
|
||||
return winchar_fromansi(szString);
|
||||
}
|
||||
|
||||
static void FreeUnicodeResString(WCHAR* szwString) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue