I'm trying to sort a list of strings where umlauts are involved, and not getting the answer I expect from QString::compare(). My sample code is:

        auto a = QStringLiteral("Äbc");
        auto b = QStringLiteral("BCD");
        auto c = a.compare(b);
        qDebug() << a << b << c;

This produces the output:

"Äbc" "BCD" 130

which indicates that Äbc should be sorted after "BCD".

I get the same result when I load the strings through QTranslator so I don't believe there's any editor/encoding issue going on.

I seem to get the right result when I let QListWidget sort the items for me though.


What am I missing?


thanks,

Hamish


_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to