h4x3d.com

- h4x3d.com

Wrong character encoding – Latin-1, UTF-8 data in MySQL

This article saved me quite some headache – also this is the cleanest solution of all. For several other workarounds, see Stackoverflow here.

The solution that works was:

mysqldump -h (your ip) -u (your username) -p  --opt --quote-names \
--skip-set-charset --default-character-set=latin1 (your db name) > (your db name)-dump.sql
mysql -h (your ip) -u (your username) -p \
--default-character-set=utf8 (your db name) < (your db name)-dump.sql

delete the brackets, dont fill in the brackets (your ip) = 127.0.0.1 for instance