Home > Web Front-end > HTML Tutorial > The difference between charset=gb2312 and charset=utf-8 of the tag in HTML

The difference between charset=gb2312 and charset=utf-8 of the tag in HTML

黄舟
Release: 2017-06-29 13:26:39
Original
8502 people have browsed it

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" />
Copy after login

charset=gb2312 means that the encoding used by the website is simplified Chinese;

The difference between charset=gb2312 and charset=utf-8 of the <meta> tag in HTML

2,

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
Copy after login

charset=utf-8 represents the world's universal language encoding;

The difference between charset=gb2312 and charset=utf-8 of the <meta> tag in HTML

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template