0xAX
0xAX

Reputation: 21817

Qt open file with cyrillic path

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.txt

How can i fix it?

Thank you.

Upvotes: 0

Views: 1079

Answers (1)

Yuriy Vikulov
Yuriy Vikulov

Reputation: 2499

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

Upvotes: 2

Related Questions