felixge/node-mysql — Issue #143: node-mysql doesn't recpect connection encoding
Author: angryziber
Created: 2011-11-25 10:49:35+00:00
State: open

node-mysql encodes all queries using utf8. This works fine, if mysql server's default encoding is also set to utf8, but storing of international characters is broken otherwise.

When opening a connection, the server specifies its default encoding, which is usually latin1 on new installations.
node-mysql can be fixed by sending SET NAMES 'utf8'; on connection if server uses something non-utf8.

As a workaround, to "fix" your mysql server, put 'default-character-set=utf8' into my.cnf/my.ini file.

And (optionally) run this on an already existing database:
alter database YOUR_DB character set utf8 collate utf8_general_ci;
alter table YOUR_TABLE charset=utf8;