In php5.4, the basic system parameter settings of Zhimeng gbk cannot save Chinese characters or do not display Chinese characters in the editor.-php Tutorial

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.