22 Jul
2009
22 Jul
'09
10:03 p.m.
On Thu, Jul 23, 2009, INADA Naoki wrote:
I found WriteConsoleW() API recently. This API can write utf16 string to console directly, without change OutputCodepage.
example: http://bitbucket.org/methane/hg-fixutf8-jp/src/tip/win32helper.py#cl-42
I think this API is good for py3k. When stdout is console and not redirected to [pipe|file], sys.stdout.write(u"foo") can avoid encoding and use WriteConsoleW(L"foo")
Please submit a feature request to bugs.python.org -- with a patch would be even nicer, of course. -- Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/ "The volume of a pizza of thickness 'a' and radius 'z' is given by pi*z*z*a"