Hi all,
I’m developing a site in english and chinese using Modx. When I try to save chinese characters they seem to be getting saved as something like:
???????
instead of something like:
密切注意有利的生产基地
I have my modx and db charsets as utf8.
When I first looked into this I found that the default charset for the db tables was latin1. To remedy this I mysqldumped the data, edited the resulting sql file to read utf8 where it once read latin1 and reintroduced the data. I had hoped this would fix the problem but actually I still cant save Chinese characters to the db.
Any ideas anyone?
Cheers
AndyFlan
Hmmmmm.
It's all a delusion
First of all, your config.inc.php should have this line:
$database_connection_charset = ’utf8’;
It’s been a while so I don’t remember if that’s enough to fix your problem. You may have to recreate the db as utf8 as well as the tables.
show variables like ’%character%’;
will show you the default database charset.
-
☆ A M B ☆
- 24,524 Posts
I was still having problems with it, and I had to have the hosting company change the my.cnf setting as well. All of my databases and tables were set to utf-8, but the MySQL main configuration file was set to iso-88whataever. Once that got set to utf-8, all my multilanguages worked. Some hosts might be able to provide you with a user .my.cnf file to specify the settings for your access to the server.