Issue with localeawarecompare in QT 4.8
-
Hello,
I am working on comparing two strings(in different languages). So, to get sorted the strings correctly, I am using localeawarecompare to compare strings. But the result is not as expected. I set the locale enviroment variables to correct language(*.utf8). But still the words are not arranged in correct order.
Do I need to set anyother variables. Please help me
-
Locale aware compare has been properly fixed in Qt 5.2. In Qt 4.8 it might not work as expected. Is an upgrade possible in your situation?
-
Try setting the text codec as the documentation suggests: "link":http://qt-project.org/doc/qt-4.8/qstring.html#localeAwareCompare, and more importantly, "link":http://qt-project.org/doc/qt-4.8/qtextcodec.html#setCodecForLocale.