mb_convert_encoding function Utf-8 to GBK, space becomes question mark question

Source: Internet
Author: User
How can I resolve this? Only the space becomes a question mark, other Chinese or something is normal


Reply to discussion (solution)

This is related to your editor, the space is not a standard space
Can you
echo Base64_encode (' Your utf-8 string ');
Post the results of a view

I suspect that's not a normal space.

This is related to your editor, the space is not a standard space
Can you
echo Base64_encode (' Your utf-8 string ');
Post the results of a view
This article says this space is a bit special, is 0xc2 0xA0.
http://hi.baidu.com/lilong2114311/item/6d0b20c87ede71c8984aa097

But I'm trying to convert.



But no effect, seek advice

This is related to your editor, the space is not a standard space
Can you
echo Base64_encode (' Your utf-8 string ');
Post the results of a view

The complete code is as follows:

 
  

This is related to your editor, the space is not a standard space
Can you
echo Base64_encode (' Your utf-8 string ');
Post the results of a view

You search the page for the "Fourth generation Fire" of the "Country of Fire" Wood Leaf Ninja Village, preceded by a four question mark.

Check the source to confirm that the few are not normal space (0x20), but 0xa0:no-break space (ie nbsp)

You can't blame someone if you write it wrong.
$str = Str_replace ("0xC2 0xA0", ", $str);
should be for
$str = Str_replace ("\xc2\xa0", "', $str);

In addition, the source code has a BOM header

  • Related Article

    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.