tags:

views:

27

answers:

1

Is it that difficult to develop a site that supports 2 byte languages (Japanese, Chinese)? I am planning to develop a multilingual site using PHP. Kindly let me know, if you know some easy methods.

A: 

‘Double-byte’ character sets are pretty much(*) a thing of the past. Today, you use the Unicode character set so a site can support every language seamlessly without the horror of switching code pages.

Write your page content saved in the UTF-8 encoding, serve it to browsers as UTF-8 and set your database tables and database connection to UTF-8. That's often enough in itself. If you need to be able to process UTF-8 strings without accidentally snipping a character in half, use mbstring.

(*: there are still a few horrible old systems in East Asia that you have to encode to nasty legacy character sets for, such as old mobile phones and some dodgy webmail services. Hopefully this won't affect you. In this case you should still use UTF-8 internally for everything, but use iconv to convert to eg. Shift-JIS on the way out.)

bobince