Re: [Python-ideas] Unicode stdin/stdout

2013-11-18 Thread Andrew Barnert
From: "random...@fastmail.us" > On Mon, Nov 18, 2013, at 7:33, Robin Becker wrote: >> UTF-8 stuff > > This doesn't really solve the issue I was referring to, which is that > windows _console_ (i.e. not redirected file or pipe) I/O can only > support unicode via wide character (UTF-16) I/O wit

Re: [Python-ideas] Unicode stdin/stdout

2013-11-18 Thread random832
On Mon, Nov 18, 2013, at 7:33, Robin Becker wrote: > UTF-8 stuff This doesn't really solve the issue I was referring to, which is that windows _console_ (i.e. not redirected file or pipe) I/O can only support unicode via wide character (UTF-16) I/O with a special function, not via using byte-based

Re: [Python-ideas] Unicode stdin/stdout

2013-11-18 Thread Victor Stinner
Why do you need to force the UTF-8 encoding? Your locale is not correctly configured? It's better to set PYTHONIOENCODING rather than replacing sys.stdout/stderr at runtime. There is an open issue to add a TextIOWrapper.set_encoding() method: http://bugs.python.org/issue15216 Victor -- https://

Re: [Python-ideas] Unicode stdin/stdout

2013-11-18 Thread Nick Coghlan
On 18 Nov 2013 22:36, "Robin Becker" wrote: > > On 18/11/2013 11:47, Robin Becker wrote: > ... >> >> #c:\python33\lib\site-packages\sitecustomize.py >> import sys, codecs >> sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach()) >> sys.stderr = codecs.getwriter("utf-8")(sys.stderr.det