Solution to Chinese garbled characters: 1. In the head part of the HTML document, use the "" statement to set the encoding method; 2. Use a web editor to open the HTML document and set the encoding to unify the files. and the encoding format of the code.
The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.
Causes of garbled characters:
#An important factor that may cause Chinese garbled characters is that the web page may not have an encoding code set , or the encoding code was not found on the web page.
Different encoding content is mixed. For example, the code of html is utf-8 encoding, and the encoding of the content is gbk. When opened with a browser, garbled characters will appear.
Many browsers cannot automatically recognize the code of the web page, which will also cause garbled code.
Solution to Chinese garbled characters
1. If the encoding is not set in html, as long as we set it in html Just set a string of codes in the A page attribute, page encoding has an encoding sub-attribute, we can set it to the corresponding attribute, as shown in the figure:
Recommended tutorial: "html Video tutorial》
The above is the detailed content of How to solve Chinese garbled characters in html pages. For more information, please follow other related articles on the PHP Chinese website!