When I was making the web page, I used the charset=utf-8 in the tag. However, in some places, the charset=gb2312 tag was also used. At this time, garbled characters appeared. . I want to use both and also want them to display correctly. What should I do? Thanks! !
1,
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
charset=gb2312 means that the encoding used by the website is simplified Chinese;
2,
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
charset=utf-8 represents the world's universal language encoding;
The most commonly used ones are charset=gb2312, charset=iso-8859-1 and charset=utf -8charset=utf-8 This encoding can be used for Chinese, Korean, Japanese and other language encodings in the world.
Characteristics of "ANSI encoding": 1. These "ANSI encoding standards" can only process UNICODE characters within their respective language ranges. 2. The relationship between "UNICODE characters" and "converted bytes" is artificially specified. 3. UTF-8, UTF-16, UnicodeBig is similar to "ANSI encoding". When converting string into "byte string" through UNICODE encoding, a UNICODE character may be converted into a byte or multiple bytes. The difference from "ANSI encoding" is: 1. These "UNICODE encodings" can handle all UNICODE characters. 2. The relationship between "UNICODE characters" and "converted bytes" can be calculated.
The above is the detailed content of The difference between charset=gb2312 and charset=utf-8 of the tag in HTML. For more information, please follow other related articles on the PHP Chinese website!