开发者

Qt open file with cyrillic path

开发者 https://www.devze.com 2023-02-18 09:03 出处:网络
I need to open file with C++/Qt. I opened it, but if there is cyrillic symbols in the file path i get:

I need to open file with C++/Qt. I opened it, but if there is cyrillic symbols in the file path i get:

/home/shk/?????????/test开发者_C百科.txt

How can i fix it?

Thank you.


QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8"))
tr(line.toAscii()) ( toUtf8 and toLatin1);

and

 QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8"))
 tr(line.toAscii()) ( toUtf8 and toLatin1);

this maybe helpful

0

精彩评论

暂无评论...
验证码 换一张
取 消