- 博客(2)
- 资源 (1)
- 收藏
- 关注
原创 QT读取window下文件名乱码问题
windows中文件名的默认编码格式为GBK,故在QT软件中显示中文,则需要将GBK编码转换为UTF-8。转换代码如下string GbkToUtf8(const char *src_str) { int len = MultiByteToWideChar(CP_ACP, 0, src_str, -1, NULL, 0);wchar_t* wstr = new wchar_t[len + 1];memset(wstr, 0, len + 1);MultiByteToWideChar(CP_ACP
2020-08-09 01:22:54
386
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人