Message223175
> - 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). |
|
Date |
User |
Action |
Args |
2014-07-16 06:07:10 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, lemburg, loewis, jaraco, vstinner, ezio.melotti, r.david.murray |
2014-07-16 06:07:10 | serhiy.storchaka | set | messageid: <1405490830.09.0.0294046144768.issue21927@psf.upfronthosting.co.za> |
2014-07-16 06:07:10 | serhiy.storchaka | link | issue21927 messages |
2014-07-16 06:07:09 | serhiy.storchaka | create | |
|