<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, 10 Aug 2016 at 11:16 Steve Dower <<a href="mailto:steve.dower@python.org">steve.dower@python.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">[SNIP]<br>
<br>
Finally, the encoding of stdin, stdout and stderr are currently<br>
(correctly) inferred from the encoding of the console window that Python<br>
is attached to. However, this is typically a codepage that is different<br>
from the system codepage (i.e. it's not mbcs) and is almost certainly<br>
not Unicode. If users are starting Python from a console, they can use<br>
"chcp 65001" first to switch to UTF-8, and then *most* functionality<br>
works (input() has some issues, but those can be fixed with a slight<br>
rewrite and possibly breaking readline hooks).<br>
<br>
It is also possible for Python to change the current console encoding to<br>
be UTF-8 on initialize and change it back on finalize. (This would leave<br>
the console in an unexpected state if Python segfaults, but console<br>
encoding is probably the least of anyone's worries at that point.) So<br>
I'm proposing actively changing the current console to be Unicode while<br>
Python is running, and hence sys.std[in|out|err] will default to utf-8.<br>
<br>
So that's a broad range of changes, and I have little hope of figuring<br>
out all the possible issues, back-compat risks, and flow-on effects on<br>
my own. Please let me know (either on-list or off-list) how a change<br>
like this would affect your projects, either positively or negatively,<br>
and whether you have any specific experience with these changes/fixes<br>
and think they should be approached differently.<br>
<br>
<br>
To summarise the proposals (remembering that these would only affect<br>
Python 3.6 on Windows):<br>
<br>[SNIP]<br>
* force the console encoding to UTF-8 on initialize and revert on finalize<br></blockquote><div><br></div><div>Don't have enough Windows experience to comment on the other parts of this proposal, but for the console encoding I am a hearty +1 as I'm tired of Unicode characters failing to show up in the REPL.</div></div></div>