Why does iconv convert unrecognized characters to 0?

Source: Internet
Author: User
Why does iconv convert unrecognized characters to 0 PHPcode & lt ;? Php $ str = & quot; 100 ㎡ & quot; $ content = iconv (& quot; gb2312 & quot;, & quot; UTF-8 // ignore & quot ;, $ str); echo $ conten why iconv converts unrecognized characters to 0
PHP code
  

  

It will output "1000 square meters". does ignore mean to ignore it? how can it be converted to 0?
If mb_convert_encoding () is used, "100? Area"
Is there a good solution?

------ Solution --------------------
Change gb2312 to gbk
------ Solution --------------------
Because gb2312 is a subset of gbk. Many special characters gb2312 are not supported. Gbk supports.
------ Solution --------------------
GBK is an extended version of gb2312. many gb2312 characters do not have the corresponding encoding.
It seems that GBK is php5 and gb2312 is php4, which is backward compatible and expanded.

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.