Jump to content

Character Encoding?


random1

Recommended Posts

I have recently read about UTF-8 page encoding: http://htmlpurifier.org/docs/enduser-utf8.html

 

I have made the switch following it's instructions.

 

I have the chinese text example 1: 激光, 這兩個字是甚麼意思

 

and chinese text example 2: 激光, 這兩個字是甚麼意思

 

How do I get the text text from example 1 to be automatically transformed into 2 using PHP? Is UTF-8 the best?

Link to comment
Share on other sites

Actually if you are making asian language websites, utf-8 encoding is not recommended at all. PHP does not collate the characters properly, and as a result searching and the like can be unreliable. If the goal is just to be able to display asian characters, then utf-8 will work, but if the site is to be an asian language site, then EUC-CN encoding should be used for chinese and EUC-JP for Japanese. These should be used as the internal PHP programming charset, and the database should also be set to this encoding. The output language should be Shift-JIS for Japanese, although I am not 100% sure what it should be for Chinese. I think either Big5 or just stick with EUC-CN.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.