MySQL on full UTF8

May 11th, 2009

On the Orion’s Belt Translation Project we had no problems with encoding, until a player from Croatia told us that Croatian’s characters weren’t being properly persisted. I tried a direct update:

update Lang set Text = 'č,ć,ž,đ,š'

And MySQL complained with an invalid characters error. To fix this I had to change the column encoding to UTF8 (was latin1). But the application still wasn’t  behaving properly. The application was sending to MySQL the following query:

update Lang set Text = 'c,c,z,d,s'

I don’t know who was transforming this (maybe the MySQL connector). To fix this I had to edit the connection string, and add the utf8 charset:

Server=s;User ID=u;Password=p;Database=d;CharSet=utf8

After these steps, everything worked fine.

Related Posts

3 Responses to “MySQL on full UTF8”

  1. Iwan Luijks Says:

    Equals to the SET NAMES or SET CHARACTER SET?

    http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html

  2. John Rockefeller Says:

    This is one of the most annoying aspects of mysql. I love it to death, but utf-8 should be the default moving foward…

  3. Artículos destacados, Mayo de 2009 | cambrico.net Says:

    [...] en MySQL, en el blog de Pablo Santos. (en [...]