Wednesday, October 20, 2010

How to Show Chinese Characters in WordPress?

My Chinese is nearly non-existent but one of my friends recently had troubles showing WordPress in his blog. The main issue is that for most systems when you create a database, the collation is set at "latin1_swedish_ci" as default. You'll need to change that to "utf8_unicode_ci" for all the tables where you plan to include Chinese characters in.

Googling for it doesn't seem to help either, but in the end we found a workaround, which is kinda lengthy but pretty easy.

Here's a step-by-step run-down:

1. Login to cPanel, run phpmyadmin:

2. Select the WordPress database you're using on the left side panel:

3. You'll see something like this, might defer from yours as some plugins will add their own tables:

4. Anyway, on this screen, under the "collation" column, if you see latin1_swedish_ci, you'll need to change that to utf8_unicode_ci!!! Click on the button 2nd from left on the column that says "Action" shown below:

5. You'll reach a page that says Structure as shown below, check everything that says latin1_swedish_ci, then click on the edit button which looks like a pencil:

6. You'll reach another page like the one below, change everything to utf8_unicode_ci, then click Save:

7. Then, when you finished saving, goto the tab that says "Operations":

8. Change again setting to utf8_unicode_ci, then press "Go":

9. Repeat steps for all that are not "utf8_unicode_ci". You should be able to write in Chinese characters now.

No comments:

Post a Comment