bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tzset: add native Windows workaround


From: Eli Zaretskii
Subject: Re: tzset: add native Windows workaround
Date: Thu, 04 May 2017 18:01:53 +0300

> From: Bruno Haible <address@hidden>
> Cc: address@hidden
> Date: Tue, 02 May 2017 22:19:16 +0200
> 
> > Also, the test "strchr (tz, '/') != NULL" allows many Cygwin-compatible 
> > TZ settings that Microsoft does not document support for, e.g., 
> > TZ="PST8PDT,M3.2.0,M11.1.0" for Los Angeles. Admittedly most Cygwin 
> > users in L.A. probably just use TZ="America/Los_Angeles" so fixing this 
> > is not that important. Still, if the intent is to limit the TZ value to 
> > what Microsoft documents, I suppose you could nuke the TZ value if it 
> > does not match the C-locale ERE 
> > "^[A-Za-z]{3}[-+]?[01]?[0-9](:[0-5][0-9](:[0-5][0-9])?)?([A-Za-z]{3})?$", 
> > or maybe put in a FIXME comment to that effect.
> 
> The full set of TZ values understood by MSVC CRT is not documented. (Maybe
> there are more valid strings than those that fit your regexp?)

Actually, I think the full set of values supported by the Windows CRT
is documented (Paul and you pointed out its URL on the MSDN).  My only
comment to the regexp above is that the first 3 characters could be
_any_ 3 bytes: the CRT doesn't care, it just skips them, and uses the
XX:YY:ZZ construct after those 3 characters to compute the timezone
offset.  Which is why the MSDN documentation explicitly says "You must
specify the correct offset from local time to UTC", because this is
the only thing that counts.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]