character collection for Chinese font, how to migrate to utf8
Posted by:
Ryan Liu
Date: November 03, 2005 04:01AM
Hi,
Character-set thing is always complicated for me after I move back to China.
I am using mysql4.1.2a version, all tables are using default Latin1_swedish_ci character collection.
When I backup database using mysql, and get a plain text file which contains Chinese. But those Chinese fonts can not be read no matter what encoding I try.
I open this plain text sql file in IE and even write my own program to read this file, I try latin1, utf8, gb2312 ... just can not read those Chinese fonts.
But if I restore it back into database using mysql <backup.sql,
again, it is readable in MySQL control center, but it can not be read in MySQL Query browser.
I also created a complete new database, this time I specify utf8 as default character set for the new database, and when I dump it, I got a utf8 encoded plain text file. And MySQL Query browser can read tables with Chinese font, but MySQL control center will just display Chinese char in a unreadable fonts.
Now I want to upgrade old Latin1_swedish_ci to utf8, how can I do it? I tried all ways I can think out, just don't work.
And how really is this character-set thing working? And I notice mysqldump and mysql command line program both accept parameter --default-character-set, what really it does?
When the table is using Latin1_swedish_ci, which encoding the mysqldump-ed file is in?
I am desperate need help to solve this problem, and thanks a lot for you help!!
Ryan