On Mon, Jul 20, 2015 at 04:20:00PM +0200, Carsten Hey wrote:
> Thanks for this great bug report!
> 
> * Rhonda D'Vine [2015-07-20 14:10 +0200]:
> >  I noticed today that pal seems to calculate the weeknumber always US
> > centric (or at least not locale aware).  If one has put show_weeknum
> > into ~/.pal/pal.conf, regardless of LC_TIME setting pal always seems to
> > calculate as if it's set to C.
> 
> A few notes:
>  * A Google search revealed DIN 1355 / ISO 8601 as possibly relevant,
>    if one wants to verify that ncal -w is indeed correct.
>  * This bug presumably isn't triggered for all years (depending on the
>    first day of the year).
>  * LC_TIME=de_DE* seems to behave as LC_TIME=C in this case.
>  * pal(1) does not mention show_weeknum.
>  * An additional relevant pal rc setting is week_start_monday.
>  * This could be useful for testing:
>        LC_TIME=C TERM=dumb datefudge "1980-01-01 00:00" ...
>  * Since ncal hardly implemented proper LC_TIME handling itself,
>    this might be related to a libc function it uses - checking if
>    setlocale() is used correctly looks like a good idea.

Interesting. I didn't think it was possile and at the very least it's
porely documented, but: it looks like the information is there:

$ LC_TIME=en_US.UTF-8 locale -k LC_TIME |grep week-1stweek
week-1stweek=7
$ LC_TIME=C locale -k LC_TIME |grep week-1stweek
week-1stweek=4
$ locale -k LC_TIME |grep week-1stweek
week-1stweek=0

This information is available via nl_langinfo(). It shouldn't be too
hard to make this usable somewhere...

Have a nice day,
-- 
Martijn van Oosterhout   <klep...@svana.org>   http://svana.org/kleptog/
> He who writes carelessly confesses thereby at the very outset that he does
> not attach much importance to his own thoughts.
   -- Arthur Schopenhauer

Attachment: signature.asc
Description: Digital signature

Reply via email to