Why does IDLE handle one symbol correctly but not another?
>>> e = '€'
>>> print unichr(ord(e))
# looks like a very thin rectangle on my system.
>>> p = '£'
>>> print unichr(ord(p))
£
>>> ord(e)
128
>>> ord(p)
163
I tried adding various # coding lines, but that didn’t help.
EDIT: browser should be UTF-8, else this will look rather strange
EDIT 2: On my system, the euro char is displayed correctly on line 1, but not in the print line. The pound char is displayed correctly both places.
The answer depends what encoding the IDLE REPL is using. You should be more explicit about what’s actually unicode text, and what’s a byte sequence. Meditate on this example:
EDIT:
As for IDLE, it’s kind of borken, and needs to be patched to work correctly.
In the first session, by the time the € is interpreted, it has already been mis-encoded, and is unrecoverable.