Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:
On Wed, Dec 8, 2010 at 1:50 PM, Hirokazu Yamamoto <rep...@bugs.python.org> wrote: .. > I got readable result. ;-) > You mean readable to *you*. :-) >>>> import time >>>> time.tzname > ('東京 (標準時)', '東京 (標準時)') This makes sense now. There are two issues here: 1. Decoding the output of wcsftime(). Python expects mbcs (which I believe is an UTF16-like wide char encoding) while Windows apparently puts cp932 there in your locale. I don't have expertise to address this issue. 2. strptime() cannot parse strftime() output when strftime('%Z') is different from time.tzname[dst]. This issue we can address. Note that for most of the locale information such as day of the week or month names, strptime() relies on strftime() output, so the round-tripping should work even when strftime() results are nonsensical. On the other hand, tz spellings are taken from time.tzname. I think we can make strptime() more robust by adding [time.strftime('%Z', (2000,1,1,0,0,0,0,0,dst) for dst in (0,1)] to the list of recognized tz names if they differ from time.tzname. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10653> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com