Chinaunix首页 | 论坛 | 博客
  • 博客访问: 290440
  • 博文数量: 68
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 706
  • 用 户 组: 普通用户
  • 注册时间: 2015-08-13 14:58
文章分类

全部博文(68)

文章存档

2021年(4)

2020年(6)

2018年(5)

2017年(13)

2016年(8)

2015年(32)

我的朋友

分类: C/C++

2020-09-07 17:02:00

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

阅读(1624) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~