[issue1602] windows console doesn't print or input Unicode

Steve Dower report at bugs.python.org
Sat Jun 21 17:12:49 CEST 2014


Steve Dower added the comment:

My understanding is that the best way to write Unicode to the console is through WriteConsoleW(), which seems to be where this discussion ended up. The only apparent sticking point is that this would cause an ordering incompatibility with `stdout.write(); stdout.buffer.write(); stdout.write()`.

Last I heard, the official "advice" was to use PowerShell. Clearly everyone's keen to jump on that... (I'm not even sure it's an instant fix either - PS is a much better shell for file manipulation and certainly handles encoding better than type/echo/etc., but I think it will still go back to the OEM CP for executables.)

One other point that came up was UTF-8 handling after redirecting output to a file. I don't see an issue there - UTF-8 is going to be one of the first guesses (with or without a BOM) for text that is not UTF-16, and apps that assume something else are no worse off than with any other codepage.

So I don't have any great answers, sorry. I'd love to see the defaults handle it properly, but opt-in scripts like Drekin's may be the best way to enable it broadly.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1602>
_______________________________________


More information about the Python-bugs-list mailing list