& Amp; lt ;? Php {code ...}? & Amp; gt; how to solve the problem by printing out garbled code in this way? I checked it online and changed the encoding format. Please kindly advise.
Header ("Content-type: text/html; charset = UTF-8"); echo "yes ";
?>
How can we solve the problem by printing out garbled code? I found it online and changed the encoding format. Please kindly advise.
Reply content:
Header ("Content-type: text/html; charset = UTF-8"); echo "yes ";
?>
How can we solve the problem by printing out garbled code? I found it online and changed the encoding format. Please kindly advise.
The Content-Type statement tells the browser that the encoding Type of the data you return is UTF-8, so your source code text should also correspond to UTF-8 encoding. open the editor, such as Geany, and then set the file encoding to a UTF-8, so that the browser can normally display the Chinese.
Use the nodepad ++ text editor or the IDE right-click File to change the file encoding format to be output.
First, make sure that the edited text is UTF-8,
Again, make sure that the output is UTF-8,
If there is a database. Please confirm database UTF-8
Multi-Check
I also encountered this problem when using sublime. I obviously saved the text in UTF-8 format.
Later, I had to open the root directory of the file and then open it and save it as a text file, and then select the encoding format.
You also need to set the encoding for the browser font.