[Tutor] Printing Chinese characters?

Alfred Milgrom fredm at smartypantsco.com
Wed Oct 15 00:25:47 EDT 2003


Hi:

I wonder if anyone can help me?

I have a string which I believe is made up of Chinese characters, but I 
cannot display it properly.
The string is
 >>> b = 
'\xba\xda\xcf?\xac\xb3\xa3\xbc\xfb\xb5\xc4\xc6\xe5\xd0?\xac\xba\xda\xc8\xe7\xba?\xf8\xb9\xa5\xa3\xbf'

This prints out as:

 >>> print b
ºÚÏ?¬³£¼ûµÄÆåÐ?¬ºÚÈçº?ø¹¥£¿

which clearly is not Chinese :)

Does anyone know if there is an encoding I could use to make it display 
correctly?
Thanks in anticipation,
Fred Milgrom





More information about the Tutor mailing list