又…又…又是中文字符导致的该问题。何时全球能都使用汉语呢!
#include<QTextCodec>//加入该头文件
QString filePath = “xx/xx/xx.xx”;
QTextCodec *code = QTextCodec::codecForName("GB2312");
std::string name = code->fromUnicode(filePath).data();
FILE* curFd = fopen(name.data(),"w+");
if(curFd == nullptr)
{
//tipstr = QString("创建文件失败:%1").arg(filePath);
//DisPlayTipMsg(tipstr,ELOG_LEVEL::LOG_ERR);
return;
}