Questions about modifying Chinese to display phpcms content

Source: Internet
Author: User
: This article mainly introduces the problem of modifying Chinese characters and not displaying phpcms content. if you are interested in PHP tutorials, please refer to it. Original site: http://www.111cn.net/wy/CMS/87635.htm

When editing an article in the background in the gbk version of phpcms2008sp4, the title and content are not displayed, for example:

After investigation, it is found that the htmlspecialchars parameter used by phpcms2008sp4 to process the document information causes the loss of Chinese characters (parameters must be supplemented in php5.4/5.5 ). Directly use htmlspecialchars ($ data [$ field], ENT_QUOTES) to return null values without any processing.

Solution:

Find in data \ cache_model \ content_form.class.php

$ Value = isset ($ data [$ field])? Htmlspecialchars ($ data [$ field], ENT_QUOTES ):'';

To:

$ Value = isset ($ data [$ field])? Htmlspecialchars ($ data [$ field], ENT_QUOTES ,'GB2312'):'';


The above section introduces the problem of modifying the Chinese text not to display phpcms content, including the GB2312 content, and hopes to help friends who are interested in PHP tutorials.

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.