I converted the MySQL 4.0 database (which did not yet have the concept of character encoding) to MySQL 5.0 four years ago, therefore BTDT.
But above all, there is no ANSI character encoding ; this is a fallacy and misunderstanding that appeared from earlier versions of Windows (there are ANSI escape sequences , but they have nothing to do with character encoding). You are certainly looking at Windows-1252- encoded text. You should convert this text to UTF-8, since then you have a better chance to keep all used characters intact (UTF-8 - Unicode encoding and Unicode contains all characters that can be encoded using Windows-125x, but in different code points).
I used the iconv and recode programs (on a Debian GNU / Linux system running the MySQL server) to convert the MySQL export text (created by phpMyAdmin) from Windows-1252 (created by phpMyAdmin) to UTF -8. Use any program or combination of programs that works best for you.
Regarding your questions:
- You can try, but it may not work. In particular, there may be a problem opening a large database dump using Notepad ++ or another text editor.
- It depends.
ALTER TABLE β¦ CONVERT TO β¦ does more than just convert encodings. - See paragraph above.
- Yes. You must set the character encoding for each table and each text field into which you are importing data into
utf8 (use any utf8_β¦ sorting that matches your purpose or the best data). ALTER TABLE β¦ CONVERT TO β¦ does this. (But see 2.) - I do not think
MYSQL323 matters here, since your export will only contain CREATE , INSERT and ALTER expressions. But first check the manual (the "?" Icon next to the setting in phpMyAdmin). latin1 means βWindows-1252β in MySQL 5.0 , so this might work, and you should skip the manual import conversion. - I do not think so; PHP does not yet support Unicode . The important thing is how the data is processed using a PHP script. Typically, the
Content-Type header field for your generated text resources using this data should end in ; charset=UTF-8 ; charset=UTF-8 .
In addition, you should no longer use MySQL 5.0.x. The current stable version of MySQL is 5.5.18 . βIn accordance with the MySQL support lifecycle policy, active support for MySQL 5.0 was completed on December 31, 2009. MySQL 5.0 is now in the extended support phase. β MySQL 5.0.0 Alpha, released 2003-12-22, Extended support is expected will end 8 years later, in 2011-12-31 (this year) .
source share