Localization strings with Unicode characters
Solved
QML and Qt Quick
-
wrote on 6 Jan 2016, 22:28 last edited by
Hi there.
I'm using Qt 4.8 and I need to localize some string in the qml file, which contains Unicode characters. Example:
Label { text: qsTr("°C") }
But after the localization, my app continue to display °C instead of درجة مئوية. What am I doing wrong?
-
wrote on 6 Jan 2016, 23:35 last edited by
Solution:
- inside main.cpp after creating the application object add the following line:
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
- inside .pro file add the following line:
CODECFORTR = UTF-8
1/2