public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug localedata/181] New: [PATCH] POSIX first_weekday should be sunday
@ 2004-05-25 21:48 pere at hungry dot com
  2004-05-25 21:51 ` [Bug localedata/181] " pere at hungry dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 14+ messages in thread
From: pere at hungry dot com @ 2004-05-25 21:48 UTC (permalink / raw)
  To: glibc-bugs

At the moment, the first_weekday value for POSIX and C locale is
saturday.  It should be sunday.  This test program demonstrates the
problem:

  #include <stdio.h>
  #include <locale.h>
  #include <langinfo.h>
  int main() {
    char *locale = "C";
    int week_1stday;
    int first_weekday;
    int first_workday;
    setlocale(LC_TIME, locale);
    week_1stday = (int)nl_langinfo(_NL_TIME_WEEK_1STDAY);
    first_weekday = *nl_langinfo(_NL_TIME_FIRST_WEEKDAY);
    first_workday = *nl_langinfo(_NL_TIME_FIRST_WORKDAY);
    printf("week_1stday for '%s' locale = %d\n", locale, week_1stday);
    printf("first_weekday for '%s' locale = %d\n", locale, first_weekday);
    printf("first_workday for '%s' locale = %d\n", locale, first_workday);
    return 0;
  }

It should print '1' for first_weekday, but prints 7 instead.
The first_* values are relative to the week_1stday date.
The value 19971130 is a sunday, so 1 would be a sunday while
7 would be a saturday.

I'll attach a patch which I believe fixes the issue.

-- 
           Summary: [PATCH] POSIX first_weekday should be sunday
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: localedata
        AssignedTo: pere at hungry dot com
        ReportedBy: pere at hungry dot com
                CC: glibc-bugs at sources dot redhat dot com


http://sources.redhat.com/bugzilla/show_bug.cgi?id=181

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 14+ messages in thread
[parent not found: <bug-181-131@http.sourceware.org/bugzilla/>]

end of thread, other threads:[~2012-03-08  4:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-25 21:48 [Bug localedata/181] New: [PATCH] POSIX first_weekday should be sunday pere at hungry dot com
2004-05-25 21:51 ` [Bug localedata/181] " pere at hungry dot com
2004-05-26 11:45 ` pere at hungry dot com
2005-10-06 18:35 ` egmont at uhulinux dot hu
2005-10-07 14:00 ` egmont at uhulinux dot hu
2006-02-21 21:53 ` decimal at us dot ibm dot com
2006-02-21 21:54 ` decimal at us dot ibm dot com
2006-02-21 21:57 ` decimal at us dot ibm dot com
2006-02-28 21:16 ` sbrabec at suse dot cz
2006-04-07 10:00 ` samuel dot thibault at ens-lyon dot org
2007-09-17 13:53 ` morten at runsafe dot no
2007-10-07 20:41 ` drepper at redhat dot com
     [not found] <bug-181-131@http.sourceware.org/bugzilla/>
2012-03-08  4:25 ` carlos at systemhalted dot org
2012-03-08  4:41 ` carlos at systemhalted dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).