how to use unicode?

Lao Coon laocoon at eudoramail.com
Mon Jan 27 07:17:53 CET 2003


gfu <gfu at public.nn.gx.cn> wrote in news:mailman.1043642087.32576.python-
list at python.org:

> hello:
>      how to use unicode to show chinese? 
>      run python.exe in w2k,Python 2.2.2:
>     >>> u'Ðж¼'
>       u'\xcb\xc6\xcd\xf8\xd2\xb3'
> 
>      run IDLE in w2k,Python 2.2.2:
>     >>> 'Ðж¼'
>      UnicodeError: ASCII encoding error: ordinal not in range(128)
>      
>      the "Ðж¼" is a chinese.

You need the u prefix as you saw, now try printing it..

Lao




More information about the Python-list mailing list