This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients amaury.forgeotdarc, belopolsky, jcea, msmhrt, serhiy.storchaka, vstinner
Date 2012-10-29.23:59:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1351555163.21.0.711514549738.issue16322@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2012-10-29 23:59:23vstinnersetrecipients: + vstinner, jcea, amaury.forgeotdarc, belopolsky, serhiy.storchaka, msmhrt
2012-10-29 23:59:23vstinnersetmessageid: <1351555163.21.0.711514549738.issue16322@psf.upfronthosting.co.za>
2012-10-29 23:59:23vstinnerlinkissue16322 messages
2012-10-29 23:59:22vstinnercreate