R. David Murray <rdmur...@bitdance.com> added the comment:

This is because python doesn't know the encoding of stdin, and so uses ASCII (I 
assume that's what 'charmap' is on windows...on my unix box the error message 
mentions ascii, not charmap).  You can tell python to use an alternate encoding 
by default via the PYTHONIOENCODING environment variable:

rdmurray:py3k>export PYTHONIOENCODING='utf8'
rdmurray:py3k>echo ü | ./python pycat.py    
ü

Of course, you'll need to use the Widows way of setting environment variables.

I think some consideration is being given to making this simpler, but I 
couldn't find an issue number for it, so I'm adding haypo as nosy since I think 
he was involved in that discussion.  If my memory is right, and there's no 
existing issue, maybe we could adopt this one for it.

----------
nosy: +haypo, r.david.murray
type:  -> behavior

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

Reply via email to