Case-insensitive sorting of strings (Python newbie)
marko at pacujo.net
Fri Jan 23 20:14:15 CET 2015
Peter Otten <__peter__ at web.de>:
> The standard recommendation is to convert bytes to unicode as early as
> possible and only manipulate unicode.
Unicode doesn't get you off the hook (as you explain later in your
post). Upper/lowercase as well as collation order is ambiguous. Python
even with decent locale support can't be expected to do it all for you.
Well, if Python can't, then who can? Probably nobody in the world, not
>>> print("re\u0301sume\u0301" == "r\u00e9sum\u00e9")
>>> print("\ufb01nd" == "find")
If equality can't be determined, words really can't be sorted.
More information about the Python-list