[Development] toLower() vs. toCaseFolded()

Mathias Hasselmann mathias at taschenorakel.de
Wed Dec 9 17:34:56 CET 2015



Am 09.12.2015 um 12:20 schrieb Marc Mutz:
> On Wednesday 09 December 2015 10:57:21 Florian Bruhin wrote:
>> * Marc Mutz <marc.mutz at kdab.com> [2015-12-09 11:54:54 +0100]:
>>> Hi,
>>>
>>> http://doc.qt.io/qt-5/qstring.html#toCaseFolded is very vague on what
>>> case folding actually _is_ and how it's different from toLower().
>>>
>>> Can someone please tell me the difference and why toCaseFolded() exists
>>> in the first place? Is it faster? Is it guaranteed to not make the
>>> string longer/shorter?
>>
>> Maybe http://www.w3.org/International/wiki/Case_folding helps?
>
> Not really. Neither does it patch our docs... :)
>
Like that W3C document says the difference really is about handling of 
characters like ß, or the different variants of I in Turkic languages. 
While doing word prediction one really wants to treat words like 
"Straße", "STRASSE" to be equal and delegate the final string matching
to the user.

Details are in http://www.unicode.org/Public/8.0.0/ucd/CaseFolding.txt, 
the rows with status field other than "C" are the interesting ones.

No, this also doesn't update the docs yet.



More information about the Development mailing list