Unicode to MBCS conversion bugs fixed
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@689 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
06dbc9a22b
commit
d9285b2cbf
2 changed files with 8 additions and 7 deletions
|
@ -49,10 +49,10 @@ void ReadVarLenArr(BYTE* &seeker, char* &readInto) {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
DWORD dwStrLen = WCStrLen((WCHAR*)arr);
|
int iStrLen = WideCharToMultiByte(CP_ACP, 0, (WCHAR*)arr, -1, 0, 0, 0, 0);
|
||||||
readInto = new char[dwStrLen];
|
readInto = new char[iStrLen];
|
||||||
WideCharToMultiByte(CP_ACP, 0, (WCHAR*)arr, dwStrLen, readInto, dwStrLen, 0, 0);
|
WideCharToMultiByte(CP_ACP, 0, (WCHAR*)arr, -1, readInto, iStrLen, 0, 0);
|
||||||
seeker += (dwStrLen)*sizeof(WCHAR);
|
seeker += WCStrLen((WCHAR*)arr)*sizeof(WCHAR);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -340,9 +340,10 @@ CResourceDirectory* CResourceEditor::ScanDirectory(PRESOURCE_DIRECTORY rdRoot, P
|
||||||
if (rdToScan->Entries[i].NameIsString) {
|
if (rdToScan->Entries[i].NameIsString) {
|
||||||
PIMAGE_RESOURCE_DIR_STRING_U rds = PIMAGE_RESOURCE_DIR_STRING_U(rdToScan->Entries[i].NameOffset + (char*)rdRoot);
|
PIMAGE_RESOURCE_DIR_STRING_U rds = PIMAGE_RESOURCE_DIR_STRING_U(rdToScan->Entries[i].NameOffset + (char*)rdRoot);
|
||||||
|
|
||||||
szName = new char[rds->Length+1];
|
int mbsSize = WideCharToMultiByte(CP_ACP, 0, rds->NameString, rds->Length, 0, 0, 0, 0);
|
||||||
WideCharToMultiByte(CP_ACP, 0, rds->NameString, rds->Length, szName, rds->Length, 0, 0);
|
szName = new char[mbsSize+1];
|
||||||
szName[rds->Length] = 0;
|
WideCharToMultiByte(CP_ACP, 0, rds->NameString, rds->Length, szName, mbsSize, 0, 0);
|
||||||
|
szName[mbsSize] = 0;
|
||||||
}
|
}
|
||||||
// Else, set the name to this entry's id
|
// Else, set the name to this entry's id
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue