Sorting a list of Unicode strings?

oliver at obeattie.com oliver at obeattie.com
Sun Aug 19 13:05:16 EDT 2007


On Aug 19, 6:01 pm, Stefan Behnel <stefan.behnel-n05... at web.de> wrote:
> oli... at obeattie.com wrote:
> > Hey Guys,
>
> ... and girls - maybe ...
>
> > Maybe I'm missing something fundamental here, but if I have a list of
> > Unicode strings, and I want to sort these alphabetically, then it
> > places those that begin with unicode characters at the bottom.
>
> That's because "Unicode" is more than one alphabet. unicode objects compare
> based on the Unicode character value, so sort() does alike.
>
> Stefan

Thanks for putting me right -- gals indeed!

Anyway, I know _why_ it does this, but I really do need it to sort
them correctly based on how humans would look at it.

Any ideas?




More information about the Python-list mailing list