Message96809
| Author |
tzot |
| Recipients |
ezio.melotti, lemburg, loewis, michael.foord, pitrou, skrah, tzot |
| Date |
2009年12月22日.19:23:43 |
| SpamBayes Score |
3.6290012e-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. |
|