[Tutor] chinese in python2.2.3

Magnus Lyckå magnus@thinkware.se
Sun Jun 8 16:46:01 2003


At 13:44 2003-06-08 +0800, jyllyj wrote:
>i think that is not good idea and I am looking forward for some good ideas.
>that's all.

What makes you think it's not a good idea?

A reason *not* to do it that I can think of, is that it
might be difficult to share the code with others outside
China that don't use UTF-8 normally.

But it'n not very convenient to use an ASCII representation
like u"\N1111\N2222\N3333". That's not readable to anyone.

 From an internationalization point of view, the best solution
might be to write everything in English and use the gettext
module to translate to Chinese. Then all chinese text would be
outside the source code. But that seems like overworking it
unless you intend to support several languages. You would have
to write all you texts in two languages, and maintain separate
files...

If you start with UTF-8 and later feel that it's a bad idea,
I suppose you can write a script that will convert your source
code, either to hex format or to a style that fits gettext.

I'd suggest doing what feels easiest right now.


--
Magnus Lycka (It's really Lyckå), magnus@thinkware.se
Thinkware AB, Sweden, www.thinkware.se
I code Python ~ The Agile Programming Language