PHP-php Tutorial

Source: Internet
Author: User
I have written an article to solve the xajax library Chinese garbled problem, speaking of iconv (UTF-8, gb2312, $ FormValues [iconv ("UTF-8", "gb2312 // IGNORE ", $ FormValues ['A'])

Ignore indicates that the conversion error is ignored. it is found that iconv fails to convert the character "-" to gb2312. without the ignore parameter, all strings after this character cannot be saved.

In addition, mb_convert_encoding does not have this bug, so the best syntax is:

Mb_convert_encoding ($ FormValues ['A'], "gb2312", "UTF-8 ");

However, enable mbstring Extension Library is required first.

You can also set the collation of the mysql database to UTF-8, which is not used for conversion.

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.