➜

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.

作者 vstinner
收信人 amaury.forgeotdarc, belopolsky, jcea, msmhrt, serhiy.storchaka, vstinner
日期 2012-10-29.23:59:22
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1351555163.21.0.711514549738.issue16322@psf.upfronthosting.co.za>
In-reply-to
内容
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).
历史
日期 用户 动作 参数
2012-10-29 23:59:23vstinner修改recipients: + vstinner, jcea, amaury.forgeotdarc, belopolsky, serhiy.storchaka, msmhrt
2012-10-29 23:59:23vstinner修改messageid: <1351555163.21.0.711514549738.issue16322@psf.upfronthosting.co.za>
2012-10-29 23:59:23vstinner链接issue16322 messages
2012-10-29 23:59:22vstinner创建