Chinese characters not displaying correctly

Asked by:
timetospeak / 5 Points
Time:
2012-02-20 1:10 am EST
Category:
Databases
Hits:
1,011
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?

To ask this user for more information, please first login.

To submit an answer, please login.

Best answer chosen by Web Hosting Hub staff

0

ChristiNi
Staff
13,688 Points
2012-02-20 8:26 pm EST
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.

To submit a comment on this answer, please first login.

Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help 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.
}