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
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
On 18/11/2013 15:25, Victor Stinner wrote:
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://bu
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://
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
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.detach())
it seems that the above needs extra stuff to ma
On 15/11/2013 18:16, random...@fastmail.us wrote:
Of course, the real solution to this issue is to replace sys.stdout on
windows with an object that can handle Unicode directly with the
WriteConsoleW function - the problem there is that it will break code
that expects to be able to use sys.stdout
Of course, the real solution to this issue is to replace sys.stdout on
windows with an object that can handle Unicode directly with the
WriteConsoleW function - the problem there is that it will break code
that expects to be able to use sys.stdout.buffer for binary I/O. I also
wasn't able to get th
BenjaMinster schrieb:
> I want to read and write unicode on stdin and stdout. I can't seem to
> find any way to force sys.stdin.encoding and sys.stdout.encoding to be
> utf-8, so I've got the following workaround:
What operating system are you using? Why do you want to do this?
Python attempts to
I want to read and write unicode on stdin and stdout. I can't seem to
find any way to force sys.stdin.encoding and sys.stdout.encoding to be
utf-8, so I've got the following workaround:
import codecs, sys
out = codecs.getwriter("utf-8")(sys.stdout)
def tricky(): return sys.stdin.readline().decod
10 matches
Mail list logo