David-Sarah Hopwood <david-sa...@jacaranda.org> added the comment:

haypo wrote:
> davidsarah wrote:
>> It is certainly possible to write Unicode to the console 
>> successfully using WriteConsoleW
>
> Did you tried with characters not encodable to the code page and with 
> character that cannot be rendeded by the font?

Yes, characters not encodable to the code page do work (as confirmed by Glenn 
Linderman, since code page 437 does not include Cyrillic).

Characters that cannot be rendered by the font print as missing-glyph boxes, as 
expected. They don't cause any other problem, and they can be cut-and-pasted to 
other Unicode-aware applications, showing up as the original characters.

> See msg120414 for my tests with WriteConsoleOutputW

Even if it handled encoding correctly, WriteConsoleOutputW 
(http://msdn.microsoft.com/en-us/library/ms687404%28v=vs.85%29.aspx) would not 
be the right API to use in any case, because it prints to a rectangle of 
characters without scrolling. WriteConsoleW does scroll in the same way that 
printing to a console output stream normally would. (Redirection to a 
non-console stream can be detected and handled differently, as the code in 
unicode2.py does.)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue1602>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to