Reference: http://stackoverflow.com/a/8690422/784637
Correct me if I'm wrong, but the best answer suggests a way to force everything being inputted into the database to be encoded in utf-8 and everything going out of the database to be encoded in utf-8.
What's the difference between the following two:
[client]
default-character-set=utf8
[mysqld]
default-character-set = utf8
Does the directive under [mysqld] force all the writes to the database to be encoded under a certain format and the directive under [client] force all of the output to be encoded in a certain format?
For example if the following two directives are set:
[client]
default-character-set=utf8
[mysqld]
default-character-set = utf8
and a there's a php string $var that is encoded in latin1, if that string is inserted into the database, it will be stored in the database as utf-8. But if a select statement is performed to retrieve that value, it would be encoded in latin1.
[client]indicates the character set the client will use to send SQL statements to the server. It also specifies the character set that the server should use for sending results back to the client. This is from dev.mysql.com/doc/refman/5.0/en/charset-connection.html – user784637 Feb 19 '12 at 4:01