how to show Chinese Characters in the value set of a dictionary

zxo102 zxo102 at gmail.com
Sun Jan 1 10:35:31 EST 2006


Hi there,
      I have a dictionary with values of Chinses Characters. For
example,

>>> dict = {}
>>> dict['c1']="中国一"
>>> dict['c2']="中国二"
>>> dict.values()
['\xd6\xd0\xb9\xfa\xb6\xfe', '\xd6\xd0\xb9\xfa\xd2\xbb']

Since the result of dict.values will be inserted into web pages and
handled by javascript there, I want to show Chinese Characters
in the list directly like this,

['中国一','中国二']

Anybody knows how to do this?   Thank you very much for your help.

Ouyang




More information about the Python-list mailing list