Store Chinse character in Mysql

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
keenlearner
Forum Commoner
Posts: 50
Joined: Sun Dec 03, 2006 7:19 am

Store Chinse character in Mysql

Post by keenlearner »

My site is 90% english, however there are some pages that i need to display in chinese character. In fact, arabic, russia, spanish. In mysql, i try to use collation utf8_general_ci . So when i input the data using phpmyadmin, i type chinese character e.g 福(lucky) into the record, save it. Unfortunately when i use php to get the data from mysql database and present it on the web, it appear as '?' (question mark). How do i show it on the web correctly ? Thank you.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

you need to specify the character encoding "UTF-8" in your web page - there's a UTF-8 tutorial on this board somewhere - do a search, it should answer all your questions.
keenlearner
Forum Commoner
Posts: 50
Joined: Sun Dec 03, 2006 7:19 am

Post by keenlearner »

Thank's for the reply. I did use utf-8 on html charset. When i use latin1, it stores Chinese character as 黑 and it's converted automatically to chinese character 黑 on the web.
Post Reply