Bug 218438 - strftime("%x") wrong with cs_CZ locale
Summary: strftime("%x") wrong with cs_CZ locale
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 6
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-12-05 11:36 UTC by Jan "Yenya" Kasprzak
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version: 2.5.90-11
Clone Of:
Environment:
Last Closed: 2006-12-06 17:49:59 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
glibc-cs_CZ-d_fmt.patch (696 bytes, patch)
2006-12-05 12:26 UTC, Jakub Jelinek
no flags Details | Diff
glibc-cs_CZ-d_fmt.patch (1022 bytes, patch)
2006-12-05 13:59 UTC, Jakub Jelinek
no flags Details | Diff

Description Jan "Yenya" Kasprzak 2006-12-05 11:36:07 UTC
Description of problem:
the "%x" date formatting string of strftime(3) or date(1) is incorrect for the
Czech locale (cs_CZ.UTF-8) - the output should not contain leading zeros.

Version-Release number of selected component (if applicable):
glibc-2.5-3

Steps to Reproduce:
1. run "LC_ALL=cs_CZ.UTF-8 date +%x"

Actual results:
05.12.2006

Expected results:
5.12.2006

Additional info:
the Czech locale should not use leading zeros for the day or month number.
It seems the "%c" formating string is correct:

$ LC_ALL=cs_CZ.UTF-8 date +%c
Út  5. prosinec 2006, 12:33:21 CET

Comment 1 Jakub Jelinek 2006-12-05 12:26:47 UTC
Created attachment 142830 [details]
glibc-cs_CZ-d_fmt.patch

Fix.  Though, I believe we need Vladimir.Michl's ack for this first.

Comment 2 Jakub Jelinek 2006-12-05 12:35:19 UTC
The month number still has leading zero, say 5.01.2006.
Wonder if d_fmt shouldn't be %e.%_m.%Y or %_d.%_m.%Y or even %-d.%-m.%Y
(I think the last one matches most the common usage, but I might be wrong).

Comment 3 Vladimir Michl 2006-12-05 13:13:27 UTC
Hi,

probably the last option, that Jakub suggests %-d.%-m.%Y is the most common one
to use.

I think, the currect version (%d.%m.%Y) is acceptable as in computer generated
forms.

So I agree with Jakub to change it to %-d.%-m.%Y.

Comment 4 Jakub Jelinek 2006-12-05 13:24:30 UTC
Similarly, for d_t_fmt, should we use %e or %-d?  I believe there the
decision is easier, the month names have variable lengths and two spaces
between day name and day of month for 1. through 9. look very ugly.
It seems strftime can't do what we really would want to do for %c though,
perticularly use different form of the full month name, we want
Ut 5. prosince 2006, 12:33:21 CET rather than Ut, 5. prosinec 2006, 12:33:21 CET.
Not sure if we could abuse %EB for this, certainly it would mean a strftime
extension and also extending LC_TIME locale format to store the alternate
forms of month names.

Comment 5 Jan "Yenya" Kasprzak 2006-12-05 13:42:47 UTC
I am for %-d here.

As for the month name variant, it would be nice to have the alternative month
names for %c, whith %EB as a repository for the alternative month names.

BTW, can the time zone names be localized as well? The "CET" name also does not
look good when embedded into the Czech text. SEČ/SELČ would definitely be better
than CET/CEST.


Comment 6 Jakub Jelinek 2006-12-05 13:59:04 UTC
Created attachment 142843 [details]
glibc-cs_CZ-d_fmt.patch

Updated patch.

Comment 7 Jakub Jelinek 2006-12-06 17:49:59 UTC
This patch is now in CVS and glibc-2.5.90-11 in rawhide.


Note You need to log in before you can comment on or make changes to this bug.