UTF-8 to GBK encoding problems, what are the good solutions?

Source: Internet
Author: User
UTF-8 to GBK encoding problems, what are the good solutions? Iconv must be added with the IGNORE parameter to complete the conversion. Otherwise, an error will be terminated. while mb_convert_encoding can complete the conversion, but sometimes the converted file will replace the Chinese comments ???.
I developed the system is the UTF-8 version, the release of the need to convert a GBK version, there is no good solution, please help.


Reply to discussion (solution)

Do you know which characters cannot be converted?
Now, can we solve this problem?

You may post a base64 encoded string containing non-convertible characters.

The content is not fixed. a PHP program of utf8 version is developed, and the entire directory is converted to GBK. baidu has searched a lot and the blank separator of UTF8 cannot be converted to GBK.

Can't you find it? Since you have found that transcoding is not the same as your problem, isn't it the same string?
Or you can create a paragraph, as long as it contains characters that cannot be transcoded.

It turns out that I am wrong. the original file is saved in ANSI encoding, and this problem occurs only after 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.