How to change the encoding method of dedecms
Modification method: 1. Back up the original website, use the background data backup function to back up the database, and package all files under the root directory of the website; 2. Use the transcoding tool to transcode the database; 3. Clear For website space information, download the new dedecms program and install it according to the new encoding method. You will get a blank, newly encoded Dream Weaver website; 4. Use web page editing software to batch encode the templates; 5. Import the transcoded data. A blank DreamWeaver website will do.
The operating environment of this tutorial: Windows 7 system, DedeCMS 5.7, DELL G3 computer
Currently MIP has strict requirements for encoding, it must be UTF -8, then for most users of GBK or GB2312, they can only convert the entire website encoding before performing MIP transformation, otherwise the transformed page will be a large mess of garbled code.
Why does MIP only support utf-8? At present, some mobile phone browsers only support UTF-8, and garbled characters will appear when opening GBK websites. Therefore, for the compatibility of mobile phones, MIP standardizes the encoding of web pages as UTF-8. At the same time, it is recommended that everyone try to use UTF-8 when making websites. Not only is it the mainstream international encoding, but the quality of the website will also be reduced. At the same time, this tutorial is applicable to cms of other PHP systems. The general principle is UTF-8 program replacement, template transcoding, and database transcoding. These three parts of the operation are. The details are explained below.
★ Transcoding preparation work - backing up the original GBK website
Before transcoding, we must have some preparations and precautions
First, back up the original website of GBK (GB2312). The steps are as follows:
First, use the background data backup function to back up the database, enter the background, and click
System - System Settings - Database Backup/Restore The database form appears here,
Click "OK" here to back up the database. The backup time varies according to the size of the database.
Second, wait for the database backup to be completed, package all the files under the root directory of the website, and back up
to where the website data and database backup are completed.
The purpose of backing up the entire site is to prevent the entire site from being restored after transcoding failure.
The complete Dreamweaver website is divided into three parts, program, template, database, we will convert these three parts in turn code operation.
The principle of transcoding is
Use Imperial Data Backup King to transcode the database,
Use DreamWeaver UTF-8 program to directly replace the GBK program,
Use a web page editor to transcode the template.
★ Transcoding work dismantling database transcoding
Database transcoding, I tested several methods and found that transcoding is the safest and most secure The complete way is to use Empire Data Backup King
We get
in the compressed package. This upload can be changed to another name and placed on the website, such as mine Change it to shuju
and then put this directory under the website. The access address is Domain name/shuju
Default background admin Password 123456
After logging in, a database setting appears. We need to enter and set the database address, database user, and database password used by the original website in sequence. (You may need to modify the default login password and random verification code, modify it yourself)
Then click "Backup Data" under "Backup and Restore Database"
The database of your original website will appear , click "Backup Data" behind the database
The page that appears at this time is very important but also very simple, just transcode here
Here We need to manually select utf8 and then back up the database, which is utf8, that is, it has been transcoded.
The storage directory needs to be remembered, because after we have backed up, we need to restore it, and we will use it when restoring
Click "Start Backup" below and the backup will be done automatically in a while
After the backup is completed, we need to restore the transcoded database back. Next, we will first transcode the program and template. The program and After the template is transcoded, we restore the database.
★ Transcoding work dismantling program transcoding
Program transcodingThe approximate steps are, after completing the backup , keep the backup package, and then clear the website space (only clear the data of the website space, Imperial Data Backup King does not clean , you still need to use it to restore the data!), download the new UTF-8 program, and install it. At this point, the transcoding work of the program part is completed.
Select UTF-8 to download, download and decompress, the file in uploads we get is the core file of the program, upload it to the website space
Detailed explanation of the installation steps. If you know how to install Dreamweaver, you can skip it here. Go directly to the next step of template transcoding.
Step 1, run your domain name/install/index.php
Step 2, check, I have read and agree to this agreement, Click to continue
Step 3. If Continue appears below, click Continue to the next step. As for the red cross, you generally don’t need to worry about it. If Continue does not appear, it means you need space. If there is a problem, please find the cause of the space yourself.
Step 4, this is the most important part. According to the picture above, we basically don’t need to choose anything when selecting the template. Let’s start the second part, database settings, here It involves several concepts: "database host", "database name", "database user", "database password", "data table prefix", and "database encoding". Please fill in the information completely against the space provider or the database information you created.
The third block is the administrator account and password. Fill it in by yourself.
The fourth block is the website settings. Change the website name to your own. You generally don’t need to change anything else, especially the cookie password. Try not to touch this, other things can be changed in the background
Do not check the initialization data to experience it, just click to continue, and the installation is complete!
I attach my installation parameters for everyone to take a look at.
The following interface appears to prove that you have successfully installed it
Transcoding part of the program That’s it. At this point, we get a blank UTF-8 DreamWeaver website.
★ Transcoding work disassembly and template transcoding
Please be sure to use professional web page editing software to perform this step!
I recommend that you use dreamweaver or Notepad. Of course, there are also small tools on the Internet for template batch GBK transcoding utf-8. Cannot be changed using Notepad! The front end can skip the template transcoding tutorial.
First of all, we need to separate our template files from the backed up website data. Among them are program template files, which are usually in a folder under the templates folder in the root directory of the website, as well as css and js files. , you need to find and replace and transcode by yourself. Since the template files and style files are different, I only use Dreamweaver to replace a web page for demonstration. In fact, the front-end laughed when I saw this. This is really nonsense...
Use dreamweaver to open one of the template files.
Click Modify - Page Properties - Title/Encoding - Encoding, and what should appear should be as shown in the figure
We select Simplified Chinese (GB2312) into Unicode (UTF-8),
all extracted template files, Transcode. After the transcoding is completed, upload it to the corresponding location of the newly installed UTF-8 website.
★ End of the transcoding work—restoring the website
At this point, the database is transcoded but not restored, and the program is transcoded but has blank data. Template transcoding is completedAt this time, use the Imperial Data Backup King to restore the databaseThe steps are to log in to the domain name/shuju and click "Backup and Restore Database" To restore data, select the data source directory, which is the directory where the database was backed up just now. Next, select the data table (that is, the original website data table) in "Database to be imported" and click to start recovery. After recovery, the original GBK database will be transcoded into utf8. Here, our website is completely transcoded from GBK to utf-8, and MIP can be transformed.★ Notes on transcoding
1. If the program has been modified or re-developed, transcoding is not recommended2. Log in to the backend after transcoding, click System Settings - System Basic Parameters, click OK in Site Settings 3, if there is an error in the generation or template, click Generate - Automatic Tasks - Update the system cache 4. Try to use the most compatible template tags for Dreamweaver template tags Dreamweaver’s transcoding process can also be applied to other PHP CMS systems for transcoding.
Recommended learning: dedecms tutorial
The above is the detailed content of How to change the encoding method of dedecms. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Empire CMS template download location: Official template download: https://www.phome.net/template/ Third-party template website: https://www.dedecms.com/diy/https://www.0978.com.cn /https://www.jiaocheng.com/Installation method: Download template Unzip template Upload template Select template

Dedecms is an open source Chinese CMS system that provides content management, template system and security protection. The specific usage includes the following steps: 1. Install Dedecms. 2. Configure the database. 3. Log in to the management interface. 4. Create content. 5. Set up the template. 6. Manage users. 7. Maintain the system.

Accurate and reliable dedecms conversion tool evaluation report With the rapid development of the Internet era, website construction has become one of the necessary tools for many companies and individuals. In website construction, using a content management system (CMS) can manage website content and functions more conveniently and efficiently. Among them, dedecms, as a well-known CMS system, is widely used in various website construction projects. However, sometimes we are faced with the need to convert the dedecms website to other formats, in which case we need to use a conversion tool

How to upload local videos using Dedecms? Prepare the video file in a format that is supported by Dedecms. Log in to the Dedecms management backend and create a new video category. Upload video files on the video management page, fill in the relevant information and select the video category. To embed a video while editing an article, enter the file name of the uploaded video and adjust its dimensions.

Template replacement can be implemented in Dedecms through the following steps: modify the global.cfg file and set the required language pack. Modify the taglib.inc.php hook file and add support for language suffix template files. Create a new template file with a language suffix and modify the required content. Clear Dedecms cache.

Learning dedecms encoding conversion function is not complicated. Simple code examples can help you quickly master this skill. In dedecms, the encoding conversion function is usually used to deal with problems such as Chinese garbled characters and special characters to ensure the normal operation of the system and the accuracy of data. The following will introduce in detail how to use the encoding conversion function of dedecms, allowing you to easily cope with various encoding-related needs. 1.UTF-8 to GBK In dedecms, if you need to convert UTF-8 encoded string to G

DedeCMS is an open source content management system that has some potential vulnerabilities and security risks: 1. SQL injection vulnerability. Attackers can perform unauthorized operations or obtain sensitive data by constructing malicious SQL query statements; 2. File Upload vulnerability, attackers can upload files containing malicious code to the server to execute arbitrary code or obtain server permissions; 3. Sensitive information leakage; 4. Unauthenticated vulnerability exploitation.

dedecms is an open source PHP content management system, specially designed for Chinese websites, with the following functions and features: User-friendly interface Powerful editor Flexible template system Multi-language support Built-in search engine optimization (SEO) Powerful user management system The advantages of the plug-in system dedecms include open source and free, high scalability, active community, easy to use and highly customizable.
