I have been using the utf8 version of the Zhimeng system. I recently tested a set of templates. However, I found that the basic settings of the system cannot be saved in Chinese. I have not found a good method on the Internet, after reading the code, I found that it was a website code problem. I had to transcode the characters in the form in php5.4. I have been using the utf8 version of the Zhimeng system. I recently tested a set of templates. However, I found that the basic settings of the system cannot be saved in Chinese. I have not found a good method on the Internet, after reading the code, I found that it was a website code problem. I had to transcode the characters in the form in php5.4.
Background-the system's basic parameters cannot be saved. the modification method is as follows:
Search in dede \ templets \ sys_info.htm
Htmlspecialchars ($ row ['value'])
Replace
Htmlspecialchars ($ row ['value'], ENT_COMPAT, 'gb2312 ′)
If you find that there are other pages that cannot save Chinese characters, you 'd better search htmlspecialchars ($ row ['value']) on the whole site in dreamweaver. then replace them with htmlspecialchars ($ row ['value'], ENT_COMPAT, 'gb2312') in batches to ensure that the system forms are correct.
However, this modification method does not support Chinese in the editor. you need to modify the editor:
Include/ckeditor/ckeditor_php5.php file
Find code
$ Out =" ". Htmlspecialchars ($ value)."\ N ";
Changed:
$ Out =" ". Htmlspecialchars ($ value, ENT_COMPAT, 'gb2312')."\ N ";
The labels are not displayed. the modification method is as follows:
1. dede/article_add.php and dede/article_edit.php will
$ Title = htmlspecialchars (cn_substrR ($ title, $ pai_title_maxlen ));
Change
$ Title = htmlspecialchars (cn_substrR ($ title, $ pai_title_maxlen), ENT_COMPAT, 'gb2312 ');
After the problem was solved, we found that all the Chinese tags in core-batch maintenance-tag management were not displayed, which is really troublesome. the modification method is as follows:
Open/dede/templets/tags_main.htm
Find:
$ Fields ['tag'] = htmlspecialchars ($ fields ['tag']);
Replace
$ Fields ['tag'] = htmlspecialchars ($ fields ['tag'], ENT_COMPAT, 'gb2312 ′);
In this way, the tag is displayed.
With this modification, the gbk version of php5.4 won't have any encoding problems.
The editor content, basic system parameters, and links are not displayed. For more information, see modify.