I’m using the mysql dbms to store pages from Wikipedia. I’ve set the character-set encoding to utf-8 (wikipedia encoding) in my.cnf file with the directive:
[mysqld]
character_set_server = utf8
And created my database with the 'chararacter set utf8' property definition.
I’ve also changed the charset-encoding for mysqld client by:
- inserting the
'charSet=utf8'property when initializing my jdbc driver. - doing a query to
'set names utf8'
However I’ve noticed that mysql server replaces some characters with others.
For example it replaces á with a.
UPDATE
I’ve run the command show variables like '%char%' ensuring that both character_set_client and character_set_set are utf8.
How can I store the correct chars in my db? Thanks!
Try to specify the encoding in the DB URL :
Here’s some more information regarding my answer :
The following is taken from the MySQL documentation (http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-charsets.html) :
I encountered a similar problem a few months ago. I checked the default value of character_set_server on my MySQL (using the “mysqld –verbose –help” command).
It was latin1.