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 serhiy.storchaka
Recipients ezio.melotti, jaraco, lemburg, loewis, r.david.murray, serhiy.storchaka, vstinner
Date 2014-07-16.06:07:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1405490830.09.0.0294046144768.issue21927@psf.upfronthosting.co.za>
In-reply-to
Content
> - when stdin is a pipe (ex: echo "abc"|python ...), the stdin encoding becomes cp1252 (ANSI code page) because os.device_encoding(0) returns None; cp1252 is the result of locale.getpreferredencoding(False) (ANSI code page). sys.stdin.readline() does not contain a BOM.

What if echo non-ascii characters? How they are encoded?

Perhaps Python should detect when it is ran under PowerShell in a pipe and set stdin (and/or stdout and stderr) encoding to CP65001).
History
Date User Action Args
2014-07-16 06:07:10serhiy.storchakasetrecipients: + serhiy.storchaka, lemburg, loewis, jaraco, vstinner, ezio.melotti, r.david.murray
2014-07-16 06:07:10serhiy.storchakasetmessageid: <1405490830.09.0.0294046144768.issue21927@psf.upfronthosting.co.za>
2014-07-16 06:07:10serhiy.storchakalinkissue21927 messages
2014-07-16 06:07:09serhiy.storchakacreate