Bug 7068 - en_GB locale has wrong week specifier
Summary: en_GB locale has wrong week specifier
Alias: None
Product: glibc
Classification: Unclassified
Component: localedata (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: GNU C Library Locale Maintainers
: 9835 (view as bug list)
Depends on:
Reported: 2008-12-04 03:29 UTC by Petr Baudis
Modified: 2014-07-01 20:55 UTC (History)
4 users (show)

See Also:
Last reconfirmed:
fweimer: security-

Proposed patch (316 bytes, patch)
2008-12-04 03:30 UTC, Petr Baudis
Details | Diff
Easily test correctness of first weekday setting (625 bytes, text/plain)
2009-01-09 17:32 UTC, Petr Baudis
Easily test correctness of first weekday setting (683 bytes, text/plain)
2009-03-07 20:31 UTC, Samuel Thibault
Easily test correctness of first weekday setting (717 bytes, text/plain)
2009-03-07 20:51 UTC, Samuel Thibault
Fix first_weekday and week (2.21 KB, patch)
2009-03-08 00:35 UTC, Samuel Thibault
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Baudis 2008-12-04 03:29:19 UTC
en_GB locale specifies in its week directive that its days list is Sunday-based,
while in fact it is Monday-based. With the recent first_w*day change from
September, this causes calendar applications to malfunction since the first
w*days now essentially point to the Tuesday string. Patch to follow.

There is a similar problem in csb_PL. Huge number of other locales have the week
directive wrong too (cs_CZ, de_DE, ...) but have first_weekday set to 1 so
usually the week just appears to start with Sunday instead of Monday which is
apparently less noticeable by users. I will start opening bugs for these locales
Comment 1 Petr Baudis 2008-12-04 03:30:22 UTC
Created attachment 3089 [details]
Proposed patch
Comment 2 Ulrich Drepper 2008-12-09 22:57:54 UTC
Test case?
Comment 3 Petr Baudis 2009-01-09 16:16:24 UTC
Sorry, I will be glad to provide one, but could you be more specific? Just a
testcase testing whether en_GB returns the correct weekstart? That doesn't look
very useful... Or something iterating all the SUPPORTED locales to check whether
their weekstart is only Sunday or Monday? There seem to be no tests like that so
far, but I'm not sure what else do you mean.
Comment 4 Petr Baudis 2009-01-09 17:32:38 UTC
Created attachment 3648 [details]
Easily test correctness of first weekday setting

Sorry, I was kind of dense I guess - you probably mean a way to reproduce and
verify the settings. I have attached a simple test application that interprets
the relevant locale data based on my current understanding of the relevant
specs. The two printed weekday names should match in correctly defined locale.
Comment 5 James Gregory 2009-02-01 12:34:22 UTC
This update has now introduced another bug, whereby the start of the week is
Tuesday, instead of Monday.

The first weekday and first workday parameters should both be 1, instead of 2:
  first_weekday 1
  first_workday 1
Comment 6 Samuel Thibault 2009-03-07 20:31:29 UTC
Created attachment 3797 [details]
Easily test correctness of first weekday setting

Here is an even better testcase: I have added what the firstday is in
english, to check that the translation is correct.
Comment 7 Samuel Thibault 2009-03-07 20:51:12 UTC
Created attachment 3798 [details]
Easily test correctness of first weekday setting

Oops, I hadn't seen that it was showing the first day of the week, not
the first day of the week system. Here is a fixed version (my concern
is to show the english name to make sure things are really correct).
Comment 8 Samuel Thibault 2009-03-08 00:35:03 UTC
Created attachment 3799 [details]
Fix first_weekday and week

Here is a patch that addresses the en_GB concern initially described
here as well as csb_PL and et_EE (same concern), and fixes week[2] into
always be 19971130, as glibc assumes this.
Comment 9 Ulrich Drepper 2009-04-25 04:44:45 UTC
OK, I applied the patch.  But if people complain I'll point to you.
Comment 10 Samuel Thibault 2009-04-25 09:51:44 UTC
No problem, I'll take the time to explain them. 
Comment 11 Petr Baudis 2009-11-22 19:12:36 UTC
*** Bug 9835 has been marked as a duplicate of this bug. ***