package playne

imports "programmer"

mysqldump and non-latin characters

So today we had an issue where transferring a MySQL database from a development server to a production server caused the text on some pages to have weird characters where apostrophes should have been. My initial thoughts of conversion between character sets was right on the money, but the fix was a little weird. You need to tell mysqldump to export in latin1 and mysql client to import in UTF8, for example:

 mysqldump -uUSER -pPASSWORD -hHOST \ 
--default-character-set=latin1 --skip-set-charset SCHEMA \
|mysql -hHOST -uUSER -pPASSWORD --default-character-set=utf8