Message174164
According to CRT source code:
- tzset() uses WideCharToMultiByte(lc_cp, 0, tzinfo.StandardName, -1, tzname[0], _TZ_STRINGS_SIZE - 1, NULL, &defused) with lc_cp = ___lc_codepage_func().
- wcsftime("%z") and wcsftime("%Z") use _mbstowcs_s_l() to decode the time zone name
I tried to call ___lc_codepage_func(): it returns 0. I suppose that it means that mbstowcs() and wcstombs() use the ANSI code page.
Instead of trying to bet what is the correct encoding, it would be simpler (and safer) to read the Unicode version of the tzname array: StandardName and DaylightName of GetTimeZoneInformation().
If anything is changed, time.strftime(), time.strptime(), datetime.datetime.strftime() and time.tzname must be checked (with "%Z" format). |
|
Date |
User |
Action |
Args |
2012-10-29 23:59:23 | vstinner | set | recipients:
+ vstinner, jcea, amaury.forgeotdarc, belopolsky, serhiy.storchaka, msmhrt |
2012-10-29 23:59:23 | vstinner | set | messageid: <1351555163.21.0.711514549738.issue16322@psf.upfronthosting.co.za> |
2012-10-29 23:59:23 | vstinner | link | issue16322 messages |
2012-10-29 23:59:22 | vstinner | create | |
|