Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #18498
| From | Marko Rauhamaa <marko@pacujo.net> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Locale bug? |
| References | <m3ty4dc5b7.fsf@elektro.pacujo.net> <8739bwop3y.fsf@enterprise.ximalas.info> <m3pqezd41b.fsf@elektro.pacujo.net> |
| Date | 2012-01-04 15:07 +0200 |
| Message-ID | <m3ipkrd3b0.fsf@elektro.pacujo.net> (permalink) |
| Organization | NBL Networks Oy |
Marko Rauhamaa <marko@pacujo.net>:
> "=?ISO-8859-1?Q?Trond_Endrest=F8l?=" <Trond.Endrestol@ximalas.info>:
>
>> Marko Rauhamaa <marko@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.
Actually, it's working as designed, no bug at all.
It turns out the "garbage" character is the nonbreaking space:
>>> print(time.strftime("%a, %d %b %Y %H:%M:%S %z (%Z)"))
ke, 04 tammi 2012 15:03:21 +0200 (EET)
The apparent intent is to make all month abbreviations equally long (six
characters).
Marko
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Locale bug? Marko Rauhamaa <marko@pacujo.net> - 2012-01-03 14:57 +0200
Re: Locale bug? =?ISO-8859-1?Q?Trond_Endrest=F8l?= <Trond.Endrestol@ximalas.info> - 2012-01-03 15:08 +0100
Re: Locale bug? Marko Rauhamaa <marko@pacujo.net> - 2012-01-04 14:51 +0200
Re: Locale bug? Marko Rauhamaa <marko@pacujo.net> - 2012-01-04 15:07 +0200
csiph-web