Pay attention to the importance of HTML language encoding
Directory
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
By changing The utf-8 in charset=utf-8 can change the encoding of the web page.
Generally when we write a CSS file, we also need to use
@charset "utf-8"; at the top of the CSS file to define the encoding type of this CSS file. Generally, the HTML source code and CSS file encoding must be unified. If they are not unified, it will lead to compatibility issues such as CSS hacks, garbled pages, and chaotic page layout.
The emergence of GB2312 basically meets the computer processing needs of Chinese characters. The Chinese characters it contains have covered 99.75% of the frequency of use. In GB2312, the collected Chinese characters are "partitioned", and each zone contains 94 Chinese characters/symbols. This representation is also called location code.
01-09 area contains special symbols.
Areas 16-55 are first-level Chinese characters, sorted by pinyin.
Areas 56-87 are second-level Chinese characters, sorted by radical/stroke.
Districts 10-15 and 88-94 are not coded.
For example, the character "ah" is the first Chinese character in GB2312, and its location code is 1601. In programs using GB2312, the byte structure usually uses the EUC storage method so that Compatible with ASCII. Each Chinese character and symbol is represented by two bytes. The first byte is called the "high byte" and the second byte is called the "low byte". The "high byte" uses 0xA1-0xF7 (add 0xA0 to the area code of area 01-87), and the "low byte" uses 0xA1-0xFE (add 01-94 to 0xA0). For example The word "ah" is stored as 0xB0A1 in most programs. (Compare with location code: 0xB0=0xA0+16, 0xA1=0xA0+1).
So the decimal system of the Chinese character area code in GB2312 encoding is from 176 to 247, and the bit code is from 161 to 255. The reason why the stored 6763 is less than 82*94=6768 is because the area code is 215, and the bit code is from 161 to 255. There are five codes between 250 and 254 without Chinese character coding, so 6768-5=6763.
GB2312 encoding can be understood as a common language in China.7. Recommended charset encoding -
TOP#If the encoding is mixed, the web page will be garbled, which is also called incompatible, especially if encoding mixing is used in CSS comments row will result in css hack.
I hope you will never forget to declare the web page encoding when making web pages in the future.
Users who have viewed this page have also viewed the following content:
1. The differences and relationships between UTF-8 GBK UTF8 GB2312
2. How to choose html encoding
3. html encoding settings
The above is the detailed content of Detailed explanation of language encoding of charset in html. For more information, please follow other related articles on the PHP Chinese website!