Author tzot
Recipients ezio.melotti, lemburg, loewis, michael.foord, pitrou, skrah, tzot
Date 2009-12-22.19:23:43
SpamBayes Score 3.629e-07
Marked as misclassified No
Message-id <1261509824.69.0.223011182118.issue6058@psf.upfronthosting.co.za>
In-reply-to
Content
re Martin's question, I can offer the indirect wisdom of Michael Kaplan
in this blog post:

http://blogs.msdn.com/michkap/archive/2008/03/18/8306597.aspx

where he mentions that the easiest way to output unicode text in the
Windows console, is:

int main(void) {
    _setmode(_fileno(stdout), _O_U16TEXT);
    wprintf(L"\x043a\x043e\x0448\x043a\x0430 \x65e5\x672c\x56fd\n");
    return 0;
}

_setmode being the special call needed.

I haven't tested with any _O_U8TEXT (if such a thing exists), I don't do
Windows anymore, therefore I can't provide a patch.

It also seems that Python —when stdin/stdout/stderr is under control of
a Windows console— doesn't use plain *printf functions. The example code
I offered in one of the other issues (dumb stdout doing plain .write as
UTF-8) runs and displays fine.
History
Date User Action Args
2009-12-22 19:23:44tzotsetrecipients: + tzot, lemburg, loewis, pitrou, ezio.melotti, michael.foord, skrah
2009-12-22 19:23:44tzotsetmessageid: <1261509824.69.0.223011182118.issue6058@psf.upfronthosting.co.za>
2009-12-22 19:23:43tzotlinkissue6058 messages
2009-12-22 19:23:43tzotcreate