Setting MySQL to display foreign character sets

Howto


If your language uses characters outside of the ASCII table, then you must be sure that all tools are configured to use UTF-8 so you can display different characters, like accented letters, or wide characters for hebrew, chinese, cyrilic, etc.

As configuration is stored in MySQL, one of the tools that needs to be configured to handle UTF-8 correctly is the database engine. You can configure MySQL to use UTF-8 Characters by setting the my.cnf file like this:

[client]
default-character-set=utf8

[mysql]
default-character-set=utf8


[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8

Do not remove your current my.cnf file, just add the settings on each section if needed. Then restart MySQL.

That will help making labels and texts with non ascii characters to be shown correctly via web.