RE: [ot] chinese web pages encoding

"Bjorn Stabell" <[email protected]>
Newsgroups gmane.org.user-groups.linux.beijing
Organization Exoweb
Message-ID <008801c4243c$1cf0b030$4500a8c0@BjornLaptop>
Colin wrote:
> GB2312 is prefered, according to my experience. Chinese users 
> will not need to change the encoding by hand then.
> 
> Paiato Matteo wrote:
> > sorry for the non-linux related question.
> >
> > I'm willing to start the localization of Spaghettilearning 
> > (e-learning italian CMS) in chinese, which encoding is better to use
GB2312, 
> > UTF-8, Unicode or ...? thank for the advise!

The most technically "beautiful" solution is to stick to Unicode
internally (any encoding of Unicode can be used for storage), and
convert to whatever encoding the user wants upon displaying the page.
Hopefully the system you're using makes this easy (Zope does).  Unicode
is great because:

- You usually have good multi-byte character support routines (str[3] is
actually a character, not a byte)

- You don't have to deal with character encoding issues internally,
which means you can mix text in different languages without worry

You can also use UTF-8 as the encoding of the HTML you serve to the
browser, and it'll work fine for Chinese users (but set the character
encoding in the HTTP headers, not just in a META tag in the HTML);
Chinese users won't have to manually select the encoding.  There used to
be a problem with the font selected for Chinese if you use UTF-8 wasn't
that good, but that's not a problem for modern browsers.

There is a problem with Unicode that you have to aware of, though.  Some
Unicode implementations on the server-side only supports UCS2 (16bit)
not UCS4 (32bit) code spaces.  GB18030 is a 32bit encoding that does not
unify the Chinese versions of Chinese characters with the Japanese and
Korean versions of the same (or very similar) characters, so you can't
do lossless round-trip conversions between UCS2 and GB18030.

Bye,
-- 
Bjorn


_______________________________________________
blug-general list
[email protected]
http://list.beijinglug.org/cgi-bin/mailman/listinfo/blug-general
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.