Chinese characters not displaying correctly

Asked by:
timetospeak
Time:
2012-02-19 9:10 pm
Category:
Databases
Hits:
565
I have Chinese characters in my database. Works great locally. I uploaded to the Hub server and all I get is "??" for the Chinese (English looks fine).

On the page:
http://www.timetospeakenglish.com/Teach_Free.php You can see that static Chinese works right on top of the page. Yet in the table on the left in the middle column under "zhtw" there are all "??".

It's pulling this data from the table "vocab" from the database "timeto7_data1"

I look at the data via phpMyAdmin and it's correct.

I declared the character type in the database to UTF8-unicode.

And I have the charset=utf-8 in my html on the page.

What's up?

You must login before you can ask a follow up question.

You must login before you can submit an answer.

Best answer chosen by Web Hosting Hub staff

0

ChristiNi
2012-02-20 4:26 pm
Hello timetospeak,

I'm sorry you're having trouble with character encoding on your site. This is usually due to the collation of your tables in the MySQL database. If you changed the character set of the database after importing your data, please note that changing the collation after importing data does not make any changes to that data. It only sets the collation for new tables and data in that database. You will either want to recreate your database and change the collation before importing your data or use the script shown in our article on how to Convert a Database to convert the data you already imported into that database.

Please note, UTF-8 is a standard collation that should work for most languages. If your data needs a different character set, you can also modify that script to to convert to a different character set by editing the following lines with the correct character set:

$sql = "ALTER TABLE $table DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci";



print "$table changed to UTF-8 successfully.\n";



Please let us know if you have any additional questions or need further assistance.

Regards,

Christi N.

You must login before you can post a comment about this answer.

Like this Question?

Have a Question?

If you need some help, submit your question to our Community! We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)

Recent Questions

  1. Wordpress 404 error
  2. email blocked from specific client
  3. WebCalendar Error While Logging On

Support Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.