1. Re-export the database (it is Ok to do this from the existing MySQL 5 database):
mysqldump -u username -p –default-character-set=latin1 –compatible=mysql40 dbname > dump.sql
2. Import the database again (overwriting the current oddly encoded tables – you do have a backup right!) :
mysql -u username -p –default-character-set=utf8 dbname < dump.sql
Note: It is not enough to just convert the database / tables with:
ALTER DATABASE db_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE tbl_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
Although this will convert the database defaults it does not perform the conversion from latin1 to utf8 on the existing actual content.