Can't print Chinese to HTTP

Gnarlodious gnarlodious at gmail.com
Mon Nov 30 13:36:17 CET 2009


Hello.
The "upgrade to Python 3.1 has been  disaster so far. I can't figure out how to print Chinese to a browser. If my script is:

#!/usr/bin/python
print("Content-type:text/html\n\n")
print('晉')

the Chinese string simply does not print. It works in interactive Terminal no problem, and also works in Python 2.6 (which my server is still running) in 4 different browsers. What am I doing wrong? BTW searched Google for 2 days no solution, if this doesn't get solved soon I will have to roll back to 2.6.

Thanks for any clue.

-- Gnarlie
http://Gnarlodious.com







More information about the Python-list mailing list