When mb_convert_encoding function UTF-8 is converted to gbk, the question mark is raised when the space is changed.

Source: Internet
Author: User
When the mb_convert_encoding function UTF-8 is converted to gbk, the question mark of space is changed. how can this problem be solved? Only space becomes question mark, and other Chinese characters are normally shared to: when the mb_convert_encoding function UTF-8 is converted to gbk, space becomes question mark.
How can this problem be solved? Only spaces are converted into question marks, and other Chinese characters are normal.

Share:


------ Solution --------------------
Check the source code and check that the Space is not normal (0x20), but 0xA0: No-Break Space (that is, nbsp)
------ Solution --------------------
You can't blame others if you're wrong.
$ Str = str_replace ("0xC2 0xA0", '', $ str );
Should be
$ Str = str_replace ("\ xC2 \ xA0", '', $ str );

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.