[Tutor] Unicode Problem
Rainer Mansfeld
MLists at romulo.de
Fri Sep 10 13:49:21 CEST 2004
Hi tutors,
I'm a Python newbie from Germany and in our language we have funny
letters like ä, ö and ü. (That would be ä ö and ü in
HTML.)
Playing around with these, I stumbled upon the following:
>>> print u'ä', 'ä'
ä ä
So print can handle Unicode and non-Unicode.
>>> print u'ä' + 'a'
äa
Concatenation seems to be no problem either, except in some cases:
>>> print u'ä' + 'ä'
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in
position 0: ordinal not in range(128)
What's happening here?
Can somebody please explain this to me?
Thanks in advance
Rainer
More information about the Tutor
mailing list