[Tutor] Printing Chinese characters?

Alfred Milgrom fredm at smartypantsco.com
Wed Oct 15 23:54:54 EDT 2003


Hi Danny:

Thanks for your reply.
Given that this is a Chinese string, I think it might be a BIG-5 encoding, 
but I am unable to find the proper encoding files.

In my distribution of Python, there is an encodings directory under 
Python22/Lib, and a file called aliases.py. As I understand it, this module 
is used by the encodings package search function to map encodings names to 
module names.

There is an interesting comment under CJK encodings (Chinese, Japanese, 
Korean) as follows:
     # The codecs for these encodings are not distributed with the
     # Python core, but are included here for reference, since the
     # locale module relies on having these aliases available.

Do you (or anyone else) know where I can get the Chinese encodings, 
including BIG-5?

Thanks in advance,
Fred Milgrom


At 02:52 PM 15/10/03 -0700, Danny Yoo wrote:

><snip>
>But that character string you've posted:
>
>###
>s = ('\xba\xda\xcf?\xac\xb3\xa3\xbc\xfb\xb5\xc4\xc6' +
>      '\xe5\xd0?\xac\xba\xda\xc8\xe7\xba?\xf8\xb9\xa5\xa3\xbf')
>###
>will need to be first decoded from whatever byte encoding it is in now
>into Unicode before any display approach will work.
>
><snip> Do you have more information on
>the byte encoding is being used for your string 's'?
>
>Good luck to you!





More information about the Tutor mailing list