> From: Bruno Haible <br...@clisp.org> > Cc: bug-gnulib@gnu.org > 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.