Chinese garbled characters-how to convert the UTF-8 string to ANSI encoding in PHP

Source: Internet
Author: User
When saving files, the system seems to only accept ANSI Chinese characters, but iconv (); mb_convert_encoding (); it seems that no direct conversion is allowed .. It is said that the default file name in WINDOWS is ANSI, but I set UTF8 on the page. When I select File Upload, there is no Garbled text. When I save the file, it seems that the system can only accept ANSI Chinese characters,
Iconv ();
Mb_convert_encoding ();
It seems that none of them can be directly converted ..
It is said that the default file name in WINDOWS is ANSI, but I set UTF8 on the page. No garbled characters appear when I select File Upload.

Reply content:

When saving files, the system seems to only accept ANSI Chinese characters,
Iconv ();
Mb_convert_encoding ();
It seems that none of them can be directly converted ..
It is said that the default file name in WINDOWS is ANSI, but I set UTF8 on the page. No garbled characters appear when I select File Upload.

$ Name = iconv ('utf-8', 'gb2312', $ file ['name']); // recode the file name using the Iconv Function

Http://www.jb51.net/article/42660.htm
Have you tried it?

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.