3 ms·
The part "Case-insensitive comparison requires case folding" says there is an algo for that, but it's up to the language to implement it. E.G: in Python 3, it'
by sametmax 7y ago
The part "Case-insensitive comparison requires case folding" says there is an algo for that, but it's up to the language to implement it.
E.G: in Python 3, it's recommend to use str.casefold() instead of str.lower() for this:
>>> "Straße".upper().lower()
'strasse'
>>> "Straße".lower()
'straße'
>>> "Straße".casefold()
'strasse'
>>>
Depending of the context, a little str.strip() and/or a str.split() + str.join() may also help. User usually don't want to consider blanks when entering data (e.g: an address), while it's important for machines (e.g: a password).
Now like @lmm said, this only normalize the codepoints. Meaning is of course, impossible to be sure that way.
- dukoid 7y agoThe example is outdated: https://en.wikipedia.org/wiki/Capital_%E1%BA%9E https://en.wikipedia.org/wiki/Capital_%E1%BA%9E