Korean encoding can be stored using UTF-8 or dedicated euc-kr encoding. In today's work, we need to transfer data from a Korean website to a local device for testing,
Then it is transferred to the database of another server. The mysql import and export tool is phpmyadmin Based on Web pages and php.
MySQL client version: 5.0.51a
MySQL Character Set: UTF-8 Unicode (utf8)
Apache/2.2.15 (Win32) PHP/5.2.13
PHP Extension: mysqli
Website data content: Korean and English, without Chinese data.
1. The export function of phpmyadmin exports Korean data from the website. We recommend that you save the exported data as zip or gzip. gzip is recommended;
2. Establish a local database, set the character set to UTF-8, finishing: utf-8-general-ci;
3. Use phpmyadmin to import the SQL file in the euc-kr character set format to the new database. In this case, you can browse Korean data;
4. You need to set the character set format in the code, because the default character set may not support correct display of Korean data on the webpage, and garbled characters may occur;
You need to set the character set of the client accessing the database and the character set of the result set returned to the client. For example, in php code:
Mysql_query ("set names euckr ");
Mysql_query ("set character set euckr ");
5. Set the default Character Set displayed on the webpage. Setting Method: <meta http-equiv = 'content-type' content = 'text/html; charset = euc-kr '>
Note: common character sets of web pages include: iso-8859-1 (English), gb2312 (Chinese), euc-kr (Korean) UTF-8, euc and so on.