Why does the HTML page still have Chinese garbled characters when UTF-8 is set?

As in the title, the problem is actually very simple. When I used EditPlus to write html pages, I found that there were still garbled characters when it was set to UTF-8.
This is a very strange problem, and I completely considered the browser's parsing problem. After placing the meta tag, I suddenly remembered
the encoding problem when saving the page. When saving the page, EditPlus defaults to ANSI encoding instead of UTF-8. Therefore, when saving the page, pay attention to selecting the encoding method as UTF-8.
If you want to modify the default encoding method of EditPlus, you can configure the default encoding to UTF-8 in tools---configure user tools.
Configuration as shown below: Reason: When saving the file to the computer hard disk, the content of the file is already related to the encoding adopted by the machine, and a certain encoding method on the computer is used to store it. In the simplified Chinese system, ANSI represents GB2312, while the traditional Chinese system seems to be GBK, while in Japanese operating system, ANSI encoding represents JIS encoding. Use 2 bytes to represent a character's font encoding in various languages, called ANSI encoding. So if ANSI is used when saving, the meta definition in the Html page is <meta http-equiv="Content-Type" content ="text/html; charset=GB2312" /> or <meta http-equiv="Content-Type" content="text/html; charset=GBK" />, since GBK is evolved from GB2312, so Both of these can be interpreted by the browser after saving, and
Why does the HTML page still have Chinese garbled characters when UTF-8 is set?








If you use ANSI when saving and use <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> in meta, there will be garbled characters, because UTF is used. When parsing such an ANSI
code in the -8 method, it will appear that it cannot be parsed normally, and there will be garbled characters. The

solution: what method is used to encode, what method is used to parse, all will be ok then For
more encoding knowledge, see the next article Reprinted article: Coding Problems Java Coding Problems

 

http://blog.sina.com.cn/s/blog_673bf2100100ue4f.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325356085&siteId=291194637