How to process Chinese using Python?

chad antonyliu2002 at yahoo.com
Fri Mar 5 13:37:07 EST 2004


I don't know how to make use of the encodings and what encoding I
should use.  The PEP 0263 page is not helpful.

Whenever I have Chinese characters in my Python code, I get this
warning message:

C:\Python23\codes>python stripper.py
sys:1: DeprecationWarning: Non-ASCII character '\xc0' in file
stripper.py on lin
e 22, but no encoding declared; see
http://www.python.org/peps/pep-0263.html for
 details

when I attempt to execute it.

It still warns even if I add 

# -*- coding: <utf-8> -*- 

to the beginning of the code, as PEP 0263 seems to have suggested.

Any idea about processing east-asian languages, Chinese in particular?



More information about the Python-list mailing list