Italics gb2312 PHP iconv function to gb2312 Bug resolution method

Source: Internet
Author: User
Iconv ("UTF-8", "Gb2312//ignore", $FormValues [' a '])
Ignore means ignoring errors at the time of conversion, and discovering that Iconv will make an error converting the character "-" to gb2312, and if there is no ignore argument, all strings after that character cannot be saved.
Another mb_convert_encoding does not have this bug, so the best way to do this is:
Mb_convert_encoding ($FormValues [' A '], "gb2312", "UTF-8");
However, you need to enable the Mbstring extension library first.
You can also set the MySQL database collation to utf-8 and not convert it.

The above is introduced in italics gb2312 php iconv function to gb2312 bug resolution, including the content of gb2312 in italics, I hope that the PHP tutorial interested in a friend helpful.

  • 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.