Python 2.5.2 on Ubuntu Hardy Utf-8-Euro error

"Martin v. Löwis" martin at v.loewis.de
Fri May 30 17:33:48 EDT 2008


> The function first normalizes the "@" away and then looks for it. Is that
> the expected behaviour?

I believe this functionality is broken by design. Python can't possibly
know correctly what each locale name on each system means, and what
encoding is used in the locale.

Instead, the system's API to find out the encoding should be used,
as exposed in locale.getpreferredencoding().

Regards,
Martin



More information about the Python-list mailing list