Message222761
I get different results that @haypo when testing Powershell on Windows 8.1 with Python 3.4.1:
C:\Users\jaraco> chcp 1252
Active code page: 1252
C:\Users\jaraco> $env:PYTHONIOENCODING=''
> How you do change the console encoding? Using the chcp command?
Yes. I recently discovered that if I use chcp 65001 in my Powershell profile, I can finally see Unicode characters output from my Python programs!
> I'm surprised that you get a UTF-8 BOM when the code page 1252 is used. Can you please check that sys.stdin.encoding is "cp1252"?
C:\Users\jaraco> echo foo | python -c "import sys; print(sys.stdin.readline())"
foo
C:\Users\jaraco> python -c "import sys; print(sys.stdin.encoding)"
cp1252
C:\Users\jaraco> chcp 65001
C:\Users\jaraco> echo foo | python -c "import locale, os; print(os.device_encoding(0), locale.getpreferredencoding(False))"
None cp1252
It seems as if something may have changed in Powershell between Windows 7 and 8.1, because my results are inconsistent with your findings.
There's a lot more to digest from your response, so I'll going to have to revisit this later. |
|
Date |
User |
Action |
Args |
2014-07-11 16:15:06 | jaraco | set | recipients:
+ jaraco, lemburg, loewis, vstinner, ezio.melotti |
2014-07-11 16:15:06 | jaraco | set | messageid: <1405095306.74.0.191708344513.issue21927@psf.upfronthosting.co.za> |
2014-07-11 16:15:06 | jaraco | link | issue21927 messages |
2014-07-11 16:15:06 | jaraco | create | |
|