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? The question mark is changed when spaces are changed to question marks and other Chinese characters are normal. when the mb_convert_encoding function UTF-8 is converted to gbk, the question mark is changed when spaces are changed.
How can this problem be solved? Only spaces are converted into question marks, and other Chinese characters can be shared:
------ 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 );
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