Fixing broken UTF-8 handling with MySQL driver

Timo Sirainen tss at iki.fi
Thu Mar 12 13:55:30 UTC 2015


On 11 Mar 2015, at 21:31, Felix Zandanel <felix at zandanel.me> wrote:
> 
> Although my MySQL installation is set up to use UTF-8 as the default charset on every level (config, database, table and field), and the character_set_* runtime variables all yield the value "utf8", it still seems that the mysql client library must be instructed to actually use UTF-8 explicitly. Adding the following statement to driver_mysql_connect() fixes the issue for me:
> 
> mysql_options(db->mysql, MYSQL_SET_CHARSET_NAME, "utf8");

I think you can also add to /etc/my.cnf :

[client]
default-character-set = utf8



More information about the dovecot mailing list