Fix MySQL dump character encoding

dump

MySQL dump uses UTF-8 when writing sql files. However, all the tables in the Gemini mambo database use latin 1 due to the fact that it was the default on MySQL 4. This encoding difference causes encoded characters to appear wrong.

The solution is to convert the existing tables to UTF-8. Unfortunatley, the conversion will only work per column, not table. The table needs to be converted into binary or as a blob before utf-8.

Fortunately, only three tables contain text for display of the mambo pages:

ALTER TABLE `mos_content` MODIFY `fulltext` BLOB;
ALTER TABLE `mos_content` MODIFY `fulltext` TEXT CHARACTER SET utf8;

ALTER TABLE `mos_content` MODIFY `introtext` BLOB;
ALTER TABLE `mos_content` MODIFY `introtext` MEDIUMTEXT CHARACTER SET utf8;

ALTER TABLE `mos_modules` MODIFY `content` BLOB;
ALTER TABLE `mos_modules` MODIFY `content` TEXT CHARACTER SET utf8;

Reference

http://www.orthogonalthought.com/blog/index.php/2007/05/mysql-database-migration-and-special-characters/