Locale bug?

M

Marko Rauhamaa

Mysterious 8-bit characters appear in the string returned by strftime.

$ python
Python 2.7.2 (default, Oct 27 2011, 01:36:46)
[GCC 4.6.1 20111003 (Red Hat 4.6.1-10)] on linux2
Type "help", "copyright", "credits" or "license" for more information.$ python3
Python 3.2.1 (default, Jul 11 2011, 18:55:33)
[GCC 4.6.1 20110627 (Red Hat 4.6.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 
?

=?ISO-8859-1?Q?Trond_Endrest=F8l?=

Marko Rauhamaa said:
Mysterious 8-bit characters appear in the string returned by strftime.

$ python
Python 2.7.2 (default, Oct 27 2011, 01:36:46)
[GCC 4.6.1 20111003 (Red Hat 4.6.1-10)] on linux2
Type "help", "copyright", "credits" or "license" for more information.$ python3
Python 3.2.1 (default, Jul 11 2011, 18:55:33)
[GCC 4.6.1 20110627 (Red Hat 4.6.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

It may be OS-specific. Your sample code runs fine on FreeBSD/i386
8.2-STABLE. The OS and Python 2.7.2 & 3.2.2 were recently compiled and
installed on my system.

trond@enterprise:~>uname -sr
FreeBSD 8.2-STABLE
trond@enterprise:~>python
Python 2.7.2 (default, Dec 20 2011, 08:49:23)
[GCC 4.2.2 20070831 prerelease [FreeBSD]] on freebsd8
Type "help", "copyright", "credits" or "license" for more information.trond@enterprise:~>python3.2
Python 3.2.2 (default, Dec 21 2011, 14:42:29)
[GCC 4.2.2 20070831 prerelease [FreeBSD]] on freebsd8
Type "help", "copyright", "credits" or "license" for more information.trond@enterprise:~>
 
M

Marko Rauhamaa

=?ISO-8859-1?Q?Trond_Endrest=F8l?= said:
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
'Ti, 03 Tam 2012 15:03:15 +0100 (CET)'

Well, "Ti" and "Tam" probably shouldn't be capitalized...


Marko
 
M

Marko Rauhamaa

Marko Rauhamaa said:
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:
ke, 04 tammi  2012 15:03:21 +0200 (EET)

The apparent intent is to make all month abbreviations equally long (six
characters).


Marko
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top