How python output a unicode string.

Y. Cheng ycheng at sinica.edu.tw
Fri Feb 23 09:01:22 CET 2001


Hi,

I try to install a big5.py on /usr/lib/python2.0/encodings
and it seem working fine. Then I try to output an string
which is u"\u9DFD" to stdout by using print. Before that,
I call

	sys.setdefaultencoding("big5")

without any error message.

As I try to output the string, I got error message:

-----------------------
  File "/usr/lib/python2.0/encodings/big5.py", line 18, in encode
    return codecs.charmap_encode(input,errors,encoding_map)
TypeError: character mapping must be in range(256)
-----------------------

is this means that python can't output multi-byte character
with unicode internal encoding ?

Yuan-Chen Cheng



More information about the Python-list mailing list