Trouble sorting lists (unicode/locale related?)

"Martin v. Löwis" martin at v.loewis.de
Sun Sep 21 16:59:34 EDT 2003


John J. Lee wrote:

>>>locale.setlocale(locale.LC_ALL, ("no", None))
> 
> [...]
> 
>>If this did work, then you can use the DSU pattern like so:
> 
> [...strxfrm...]
> 
> The advantage of which is that you don't have to mess with the locale.

No, it doesn't. strxfrm requires that the locale is adjusted to the
desired LC_COLLATE facet. Otherwise, it will collate according to the
C locale (in which case strxfrm is the identity).

Regards,
Martin





More information about the Python-list mailing list