QsTr() and non-ASCII characters
-
wrote on 15 Jun 2012, 14:10 last edited by
Has anyone successfully used qsTr() with a source string containing non-ASCII Latin-1 characters? I just cannot make it work.
Especially not with Qt 4.8.2. Using 4.7.4 it seems to work on the target Windows CE device, but not on Windows. Using 4.8.2, there seems to be an additional conversion to UTF-8, which makes the string get an extra Â. This means no translation is found, because the translation file does not contain the extra Â, and the string returned by qsTr() is the string with the extra Â. -
wrote on 18 Jun 2012, 02:39 last edited by
Hi,
There was a known issue with this in 4.7, but it should be working in 4.8 (see https://bugreports.qt-project.org/browse/QTBUG-14989 for details). I'd suggest opening a new bug if this isn't working correctly in 4.8.2.
Regards,
Michael -
wrote on 18 Jun 2012, 20:55 last edited by
The bug report deals with non-Latin-1 characters, my problem is with Latin-1 characters.
I made a simple example which works as expected on Windows with 4.7.4, but does not work with 4.8.2 (or 4.8.0). I will file a bug report for this. -
wrote on 18 Jun 2012, 23:35 last edited by
Hi,
Oops, sorry for the confusion. One other thing you could check is the encoding of the QML file, as the QML engine expects all files to be UTF-8 encoded.
Regards,
Michael -
wrote on 19 Jun 2012, 08:05 last edited by
QML file is UTF-8, C++ files are Latin-1.
Filed a bug report for this as "QTBUG-26193":https://bugreports.qt-project.org/browse/QTBUG-26193.
1/5