BUG:

Drupal doesn't work seamlessly with MySQL UTF8 charset. In addition to set default-character-set = utf8 in MySQL configure file my.ini, and create all tables with utf8, the client connection has to be established using utf8 as well. Otherwise you will get funky characters.
I don't suggest to setup default client connect as UTF8 on mysql server side for all clients, coz people may have some other clients using other charset. Instead,

FIX:

After establish mysql connect, immediately issue the command:
mysql_query('SET NAMES utf8');

For example, with 4.6.2, in the file: includes/database.mysql.inc, line 33, add mysql_query('SET NAMES utf8'); after the mysql_connect() and before return.

It has been tested and works fine on MySQL server that also has other client databases using other charset like GBK, BIG5 instead of UTF8.

Hongyi Gao

Comments

greggles’s picture

Component: base system » database system
Status: Active » Closed (duplicate)

Good find - it has also been found and is being fixed in other issues, so I'm marking this one duplicate.

See http://drupal.org/node/40515