CP_ACP 指示 API 使用当前设置默认的 Windows ANSI 代码页
修改unzip.cpp
MultiByteToWideChar(CP_UTF8,0,fn,-1,tfn,MAX_PATH);
为
MultiByteToWideChar(CP_ACP,0,fn,-1,tfn,MAX_PATH);
bool CommonFunction::Unzip(const std::wstring & zipFile, const std::wstring & folder)
{
bool result = true;
SetCurrentDirectory(folder.c_str());
HZIP hz = OpenZip(zipFile.c_str(), 0);
ZIPENTRY ze;
GetZipItem(hz, -1, &ze);
int numitems = ze.index;
for (int i = 0; i < numitems; i++)
{
GetZipItem(hz, i, &ze);
ZRESULT rst = UnzipItem(hz, i, ze.name);
if (wcscmp(ze.name, L"HwasstHelper.exe") == 0 ||
wcscmp(ze.name, L"HwasstService.exe") == 0 ||
wcscmp(ze.name, L"HwasstTool.exe") == 0)
{
result = (result && (rst == ZR_OK));
LOG_TRACE(0, "%ls %d", ze.name, rst);
}
}
CloseZip(hz);
return result;
}
阅读(1777) | 评论(0) | 转发(0) |