This article is a mirror article of machine translation, please click here to jump to the original article.

View: 22685|Reply: 9

[Website Builder] dz database gbk to utf8 tool

[Copy link]
Posted on 8/9/2017 9:43:27 AM | | | |
Now UTF8 is the mainstream of websites, because in domestic GBK-coded websites, there will be no garbled characters when opened

However, if you open a domestic GBK-coded website abroad, if your computer does not install the GBK-coded font library, it will cause foreign friends to open our website and display garbled characters

Moreover, UTF8 is an international encoding, and the disadvantage is that it occupies more space than GBK encoding in terms of storage

In short, converting to utf8 has many benefits, and the other steps of converting dz website gbk to utf8 are easy to do, and it is difficult to transcode in the database

dz in GBK and UTF8 databases, some storage is not the same

dz Some fields recorded in the "serialization code" are invalid in UTF8 due to the different character bits occupied by GBK and UTF8 characters.

Comparing the classification information, GBK is recorded like this:

{i:1; s:4: "Plot"; i:2; s:4: "Role"; i:3; s: 6: "cast and crew"; i:4; s:4: "peripheral"; i:5; s:4: "English"; i:6; s:4: "inventory"; i:15; s:4: "Resources"; i:16; s:4: "Information"; i:17; s:8: "related nouns"; }


Among them, the two words plot account for 4 characters, so it is written as s:4, which is invalid when placed in the encoding of utf8, because the correct writing of utf8 should be s:6, and two Chinese characters account for 6 characters. This record should be amended to:

{i:1; s: 6: "Plot"; i:2; s:6: "Role"; i:3; s: 9: "Cast and crew"; i:4; s: 6: "peripheral"; i:5; s: 6: "English"; i:6; s:6: "Inventory"; i:15; s:6: "Resources"; i:16; s:6: "information"; i:17; s:12: "related nouns"; }



The following figure shows a record in my GBK database table:



For these fields that are serialized and stored, how to convert GBK to UTF8 serialized format storage?

Some big bulls on the Internet have written tools, but the serialized table is incomplete, or there is a problem.

Because this website is where I transferred from GBK to UTF8, I found some problems and corrected them myself.

Just modify the following parameters

$dbserver = 'database address';
$dbusername = 'Database Account';
$dbpassword = 'database password';
$database = 'database name';


Then, after the modification is completed, upload php to any directory of the website and access the php file address! Finally, click on the button "Discuz!" Serialization and sorting".




php script download:

Tourists, if you want to see the hidden content of this post, pleaseReply







Previous:Mysql NN means
Next:LINQ left, right, and inner connections
Posted on 8/11/2017 5:30:50 PM |
It's good to read it
Posted on 8/29/2018 7:23:15 AM |
3332652365236523652
Posted on 3/7/2019 3:07:45 AM |
Thank you, elder
Posted on 4/1/2019 9:48:58 PM |
I've been looking for this for a long time, thank you
Posted on 5/7/2019 7:44:37 PM |
222, thank you for sharing haha.
Posted on 5/26/2019 5:37:41 PM |
Thank you, big elder, thank you, big elder
Posted on 6/15/2019 4:22:38 PM |
Can it be used?
Posted on 10/17/2019 2:53:31 AM |
Want to see what it is
Posted on 10/17/2019 3:07:20 AM |
No, click Serialize and can't find the page prompt
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com