Which of the following experts can help me solve the garbled problem?

Source: Internet
Author: User
Who can help me solve the garbled problem ..... In my php file, the header of the message written into the html file is encoded in UTF-8, and then the output is garbled. who can teach me the encoding problem... Headache !!!, Look at the database encoding, it is best to unify the encoding !, Php file into UTF-8. UTF-8 is used for non-numeric fields in the database ., If the header encoding is UTF-8, the php program will solve the garbled text problem for me .....
In my php file, the header of the message written into the html file is encoded in UTF-8, and then the output is garbled. who can teach me the encoding problem... Headache !!!

------ Solution --------------------
Look at the database encoding, it is best to unify the encoding!
------ Solution --------------------
Php file into UTF-8. UTF-8 is used for non-numeric fields in the database.
------ Solution --------------------
The header encoding is UTF-8, so the php program outputs UTF-8 encoded data.
As long as the output content does not contain static Chinese characters (directly written in a program), no matter what encoding is used to save the program file, the basic ASCII characters are the same in various common language encodings.
If dynamic text is not UTF-8 encoded, encoding conversion is required.
For example, you need to execute
Mysql_query ('set names utf8 ');

------ Solution --------------------
Discussion
In my php file, the header of the message written into the html file is encoded in UTF-8, and then the output is garbled. who can teach me the encoding problem... Headache !!!

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.