My First Car, Honda City 2009
 

cannot display chinese characters

You were searching for "cannot display chinese characters". These posts might be of interest:

  • No related posts.

Solved: Drupal Cannot Display Chinese Characters (Unicodes)

Filed in: Open Source, Tips n Tricks, Web Development — May 12th, 2008

advertisement

I have a community site powered by Drupal but it cannot display chinese characters, even though it supports unicode by default.

All non-English characters are displayed as question marks (???). I tried to reinstall Drupal but without any luck. Yesterday, I finally discovered the problem and solved it!

The problem

Last time, I installed Drupal using the cPanel Fantastico script installer. The installer created database using Latin collation. That’s why Drupal cannot display Chinese characters because the database is not unicode (UTF-8).

Lesson learned: Do not install script using cPanel Fantastico.

The solution

The solution is simple, correct the tables’ collation to UTF-8 using the following SQL query (thanks to neo_fox):

ALTER TABLE table_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;

I ran the query using phpMyAdmin found in cPanel hosting control panel. But the drawback is that you need to run the SQL query for every single table…

I modified 20+ tables and it works! Now my friends can leave chinese message on the community website. :D

Tags: , , , ,

Bookmark and Share

Read also:

What do you think? 8 Responses to “Solved: Drupal Cannot Display Chinese Characters (Unicodes)”

Comments Feed | TrackBack URL
  1. #1
    Gecko Says:

    What is the address of the site? would like to see what mr.liew is up to.

  2. #2
    LcF Says:

    Just a private community site for friends to rant. Nothing serious there ;)

  3. #3
    hanep Says:

    good info. thou’ im not going to use the chinese characters, but this helps me handling php scripts out there. thanks

  4. #4
    Alien TYC Says:

    I think wordpress has this problem as well. Have not fix my wordpress yet so that I can blog in chinese..

  5. #5
    LcF Says:

    @Alien TYC: wordpress has a different solution. Check out “Fix Wrong Encoding after Upgrade Wordpress 2.2

  6. #6
    macrunch Says:

    I m your friend?what is the site URL?

  7. #7
    noclegi Ustka Says:

    It’s not working for me;/ Maybe I’m doing something wrong but what?

  8. #8
    somedude Says:

    Thx dude! This article help me to solve same problem with russian language!

Comments are closed. Submit your comment here