Locale bug?
Marko Rauhamaa
marko at pacujo.net
Wed Jan 4 07:51:28 EST 2012
"=?ISO-8859-1?Q?Trond_Endrest=F8l?=" <Trond.Endrestol at ximalas.info>:
> Marko Rauhamaa <marko at pacujo.net> writes:
>> $ python3
>> >>> locale.setlocale(locale.LC_TIME, ('fi_FI', 'UTF-8'))
>> >>> time.strftime("%a, %d %b %Y %H:%M:%S %z (%Z)")
>> 'ti, 03 tammi\xa0 2012 14:51:57 +0200 (EET)'
>
> It may be OS-specific.
You're right. It's a generic linux problem (in the coreutils rpm of
Fedora). An analogous C program demonstrates the same issue.
> Your sample code runs fine on FreeBSD/i386
> trond at enterprise:~>python3.2
> >>> locale.setlocale(locale.LC_TIME, ('fi_FI', 'UTF-8'))
> >>> time.strftime("%a, %d %b %Y %H:%M:%S %z (%Z)")
> 'Ti, 03 Tam 2012 15:03:15 +0100 (CET)'
Well, "Ti" and "Tam" probably shouldn't be capitalized...
Marko
More information about the Python-list
mailing list