python unicode display of chinese characters

Posadas, Dennis dennis.posadas at intel.com
Tue Dec 9 18:04:00 EST 2003


Hi,

	I've done some google searching w/c referred me to a couple of
articles on unicode, but I'm looking for something really simple - not
for a web application.

	See my sample code below. Any ideas how to convert it to display
maybe Simplified Chinese ?

Rgds,
Dennis

====================================================
#ucode.py

#get unicode number
ucode_num = str(raw_input('Enter the string : '))

#define constants
encode_type = 'utf-8'
display_type = 'cp-347'		#for IBM consoles

#define unicode
character_display = unicode(ucode_num, encode_type)


#print character to be displayed
print character_display.encode(display_type)





More information about the Python-list mailing list