gb to chinese unicodes

Martin v. Loewis martin at v.loewis.de
Mon Jan 14 19:44:56 EST 2002


David Phoon <david.phoon at retriever.com.au> writes:

> what i want to understand is how the library chinesecn etc gets
> installed? 

If it is properly packaged, you should be able to do "python setup.py
install". Please read the file README.en.

> ie do they come from python2.x distributions? or do you have to install
> them as separate libraries.. 

They are separate libraries.

> if so would that not mean modifying other files like __init__ to
> cater for the additional libs? ref to the source code below:
>
> from encodings.chinesecn import euc_gb23122utf, utf2euc_gb2312

There is no need to modify any __init__ file of Python. The codecs in
the package are available under the names chinese.euc_cn and
chinese.gb2312 (see README.en again for details).

That is, after installing them, you should be able to do

  unicode("foo", "chinese.gb2313")

Regards,
Martin



More information about the Python-list mailing list