Converting MySQL Database to Unicode
This article is an excellent resource:
http://www.geeklog.net/article.php/200410120657418
Basically if you want to convert your data to unicode (utf-8), then to preserve your european characters with accents like é à ç, you have to
1) do a mysql dump
2) convert the fields to utf-8 in the table structure (I use utf8_unicode_ci)
3) use a text editor, like EditPad Pro, to convert the mysql dump file into UTF-8.
4) use another text editor, like Textpad, to delete the first three junk characters:
"" You can see these by opening Textpad in binary mode (which is read-only).
Then to delete the junk, open it in Textpad's regular mode. Then delete the first character in the file and re-enter it using the keyboard (This is weird, but it appears to clear the hidden three junk characters). Then open it in Textpad using the "binary" mode to verify that they are gone.
In my experience, EditPad Pro won't show these first three characters (in its binary mode - which you can access with ctrl-h), but Textpad will (in its binary mode). On the other hand, Textpad isn't reliable for converting things to UTF.
If you don't delete these first three characters, then the MySQL dump will give you an ERROR.
5) Dump the file back into MySQL.
- Login to post comments