idle 2.x and unicode literals
Joe P. Cool
joe.p.cool at googlemail.com
Fri Apr 2 05:02:24 EDT 2010
Hi,
I'm working with Python 2.6.4 on Ubuntu 9.10 and noticed a difference
between IDLE and command line python. If I enter an é (accented e,
LATIN SMALL LETTER E WITH ACUTE) as a unicode string in command line
python I get this:
>>> u'é'
u'\xe9'
In IDLE 2.6.4 I get this:
>>> u'é'
u'\xc3\xa9'
IDLE is set to UTF-8 and console environment has LANG = en_US.UTF-8.
This is a bit annyoing because ord(u'é') works on the command line but
raises an exception in IDLE:
>>> ord(u'é')
Traceback (most recent call last):
File "<pyshell#7>", line 1, in <module>
ord(u'é')
TypeError: ord() expected a character, but string of length 2 found
Is this a bug? IDLE 3.1.1 works.
Cheers,
Joe
More information about the Python-list
mailing list