Sorting strings containing special characters (german 'Umlaute')

Hallvard B Furuseth h.b.furuseth at usit.uio.no
Fri Mar 2 10:29:24 EST 2007


DierkErdmann at mail.com writes:
> For sorting the letter "Ä" is supposed to be treated like "Ae",
> therefore sorting this list should yield
> l = ["Aber, "Ärger", "Beere"]

Are you sure?  Maybe I'm thinking of another language, I thought Ä shold
be sorted together with A, but after A if the words are otherwise equal.
E.g. Antwort, Ärger, Beere.  A proper strcoll handles that by
translating "Ärger" to e.g. ["Arger", <something like "E\0\0\0\0">],
then it can sort first by the un-accentified name and then by the rest.

-- 
Hallvard



More information about the Python-list mailing list