How to print this character u'\u20ac' to DOS terminal

人言落日是天涯,望极天涯不见家 kelvin.you at gmail.com
Wed May 30 01:04:29 EDT 2007


Who could explain the follow issue ?

>>> print u'¦¤'
¦¤
>>> print u'€'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'gbk' codec can't encode character u'\x80' in
position 0: il
legal multibyte sequence
>>>

or I just put the unicode number
>>> print u'\u0394'
¦¤
>>> print u'\u20ac'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'gbk' codec can't encode character u'\u20ac' in
position 0:
illegal multibyte sequence
>>>

My terminal is cmd.exe under windows XP.
what's the different between the two character ? what can I do if I
want to print the u'\u20ac'?




More information about the Python-list mailing list