UTF8 problem with MySQL 5

Have you tried adding

SET NAMES 'utf8';

to your sql dump?

The thing with utf8 or encodings in general is that in order to be successfull, you have to make sure that:

  • the file is encoded utf8 without signature
  • the default encoding of the mysql server is set to utf8
  • the connection is utf8 (that’s why you put SET NAMES ‘utf8’ into your sql-file).
  • all tables and columns have the right encoding and charset
  • all your webfiles have to be utf8 encoded as well. And it doesn’t work to just add the correct header. You have to open the file, check if the encoding is utf8, if not, cut everything, change the encoding to utf8 and paste everything back. It doesn’t work, if you just change the encoding and save the file!

Leave a Comment