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:
kichik 2007-01-25 13:08:32 +00:00
parent 249903acc8
commit 01ebc199ef

View file

@ -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) {