First of all, the forum's managers and some of the forum on the sidelines of the people expressed regret.
Yesterday met GBK and UTF8 mutual turn problem, check a lot of data have not figured out, post questions nobody, to the management message is also heard.
Spent a few hours, looked up a lot of information (other forums), after the N-word failure finally converted to success, here to share to everyone, hope to provide help to the needy students.
Needless to say, the following are the necessary steps to convert, not necessarily suitable for everyone, so we hope that everyone before starting to backup good data. (Database and template materials)
GB2312 Turn UTF8:
First step: Open phpMyAdmin, export the Dedecms database (export>>save as file >>go)
The second step: Use Notepad to open the first step of the exported file, the GB2312 in which all replace the UTF8, and then save, save time encoding select Utf-8.
Step three: Install the UTF8 encoded DEDECMS program
Fourth step: Open phpMyAdmin to empty the data in the newly installed UTF8 version of the database (Structure>>select all>>go)
Fifth Step: Import, select the database file saved in the second step. (Import>>go)
So far, the data transformation and import succeeded.
///////////////////////////////
Souroot Note:
After the database has been converted to UTF-8, there are three things:
1) PHP to the database before all add Mysqli_query ($conn, "Set names UTF8"), so that in the transmission, the return of the results are used UTF-8 encoding;
If Mysqli_query ($conn, "Set names gb2312"), the background will be in the operation of the database, such as reading the database data, first to GB2312 to the client, or to get GB2312 data, the database is specifically encoded (this is UTF-8) , and then save to the database;
2) The UTF-8 code is indicated on the webpage.
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
3) for a PHP file with output HTML text, the file itself should be specifically for the UTF8 format encoding (preferably no BOM format, or PHP that the BOM format itself has been calculated output, this will affect the session start);
MYSQL GB2312 data converted to UTF8 data