[issue17348] Unicode - encoding seems to be lost for inputs of unicode chars

R. David Murray report at bugs.python.org
Sun Apr 21 22:02:01 CEST 2013


R. David Murray added the comment:

I believe you have indeed understood what the original poster was reporting.

However, those lines date back a long time (2002 or earlier).  They exist in Python2 only, and there they have a purpose, so they can't just be deleted.

My guess is the problem is a conflict between the locale setting and the encoding used when the character string is input into IDLE.

For me, if I cut and paste that string into the idle shell in python2, it shows up as the unicode escape characters (meaning IDLE is doing the correct conversion at input time on my system).  In Python3 it looks the same, except that the echoed output shows the expected glyphs instead of the unicode escapes as it does in Python2, which is as expected.

My only locale setting, by the way, is LC_CTYPE=en_US.UTF-8.  What is your setting?

I don't know if there is a better way for idle to behave in the modern era or not.  Perhaps it should be using utf-8 by default instead of the locale?  Do you know how (and in what charset) your system is generating the characters you type into idle?

----------
nosy: +r.david.murray

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17348>
_______________________________________


More information about the Python-bugs-list mailing list