Trouble sorting lists (unicode/locale related?)

"Martin v. Löwis" martin at v.loewis.de
Sun Sep 21 22:59:34 CEST 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