After the. html file is saved as a. php file, all Chinese characters are question marks. What should I do if I suspect it is related to php or apache?

Source: Internet
Author: User
Tags html header
After the. html file is saved as a. php file, all Chinese characters are question marks. What should I do if I suspect it is a problem with php or apache? For example, the question is a garbled question ...... Reference: For garbled characters, check whether the following encoding items are consistent: if the encoding used by the database is consistent with the encoding of the encoding file used on the current page, the problem will be solved ., After the. html file is saved as a. php file, all Chinese characters are question marks. What should I do if I suspect it is a problem with php or apache?
Example

------ Solution --------------------
Discussion

It's also a garbled problem ......

Reference:

For garbled characters, check whether the following codes are consistent:

Encoding used by the database
Encoding used for database operations
Encoding used on the current page
File encoding

If they are consistent, there will be no problem.

------ Solution --------------------
Set the file encoding and html header encoding correctly.





------ Solution --------------------
Mysql databases, php files, and php files must be completed.

Correct settings:
For example, all are UTF-8
Set mysql database to utf8 unicode,
Php header:
The most important thing is that the php file is UTF-8 encoded. the default value is ansi.
Method: Open the php file in Notepad and save it as UTF-8.
OK!

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.