jamina1 Posted February 13, 2009 Share Posted February 13, 2009 Hello! We have a weird problem with PHP, MySQL, Phpmyadmin and some chinese characters. The page in question has a "contact" form - which emails to our sales department. We *finally* got chinese characters coming through the email by converting the page to utf8. However, now that we're storing the data in our database we've come across a problem. When I do show variables like 'c%'; I get the following: +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | latin1 | | character_set_connection | latin1 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | latin1 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | | collation_connection | latin1_swedish_ci | | collation_database | utf8_general_ci | | collation_server | utf8_general_ci | With this setup, we put some chinese characters through PHP. They go in, and when we query through PHP they look fine. But in phpmyadmin they look like this: 测仪è”系(美国). Not cool. So I tried to convert all the other things to utf8 by using the SET NAMES 'utf8'; Here's what it looks like after the SET NAMES: +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | | collation_connection | utf8_general_ci | | collation_database | utf8_general_ci | | collation_server | utf8_general_ci | But it STILL looks like 测仪è”系(美国) in phpmyadmin. We need 本网站发送的所有电子邮件都有记录以用于商店管理 to look like chinese, not 测仪è”系(美国). How can we accomplish this? Quote Link to comment https://forums.phpfreaks.com/topic/145090-php-mysql-unicode-and-chinese-characters/ Share on other sites More sharing options...
corbin Posted February 13, 2009 Share Posted February 13, 2009 That's strange.... I just tried inserting that and then looking in PHPMyAdmin and it works fine x.x. character_set_client utf8 character_set_connection utf8 character_set_database latin1 character_set_filesystem binary character_set_results utf8 character_set_server latin1 character_set_system utf8 character_sets_dir C:\Program Files\MySQL6\share\charsets\ collation_connection utf8_general_ci collation_database latin1_swedish_ci collation_server latin1_swedish_ci The table is utf8_unicode_ci. PHPMyAdmin 3.0. There isn't a multilingual version of PHPMyAdmin is there? Maybe yours is defaulting to displaying everything in ASCII or something. Quote Link to comment https://forums.phpfreaks.com/topic/145090-php-mysql-unicode-and-chinese-characters/#findComment-761404 Share on other sites More sharing options...
Mchl Posted February 13, 2009 Share Posted February 13, 2009 Remember tu use SET NAMES 'utf8' each time you connect from PHP to MySQL. Quote Link to comment https://forums.phpfreaks.com/topic/145090-php-mysql-unicode-and-chinese-characters/#findComment-761405 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.