[Interest] unexpected result from QString::compare
Florian Bruhin
me at the-compiler.org
Fri May 8 10:54:51 CEST 2020
On Fri, May 08, 2020 at 08:51:19AM +0000, Hamish Moffatt wrote:
> On 8/5/20 5:13 pm, Fabrice Mousset | GEOCEPT GmbH wrote:
> > Perhaps you should use QString::localeAwareCompare() ?
>
>
> Thanks, I didn't know about that. Maybe the QString::compare() documentation
> could mention it...
From https://doc.qt.io/qt-5/qstring.html#compare :
Case sensitive comparison is based exclusively on the numeric Unicode values
of the characters and is very fast, but is not what a human would expect.
Consider sorting user-visible strings with localeAwareCompare().
Florian
--
me at the-compiler.org (Mail/XMPP) | https://www.qutebrowser.org
https://bruhin.software/ | https://github.com/sponsors/The-Compiler/
GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
I love long mails! | https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200508/9c7e16bf/attachment.sig>
More information about the Interest
mailing list