This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients pbos, r.david.murray, vstinner
Date 2010-08-06.19:32:17
SpamBayes Score 1.6416388e-06
Marked as misclassified No
Message-id <1281123139.56.0.373159207669.issue9511@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-08-06 19:32:19r.david.murraysetrecipients: + r.david.murray, vstinner, pbos
2010-08-06 19:32:19r.david.murraysetmessageid: <1281123139.56.0.373159207669.issue9511@psf.upfronthosting.co.za>
2010-08-06 19:32:17r.david.murraylinkissue9511 messages
2010-08-06 19:32:17r.david.murraycreate