Recently, many students have asked me about web page encoding. What is the difference between gb2312 and utf-8 encoding? Let’s summarize today. Recently, many students have asked me about web page encoding. What is the difference between gb2312 and utf-8 encoding? Today's summary: I don't know if you have ever encountered the problem of style definition not taking effect when making a page. The basic manifestation is that no matter how you change the style, it will not be displayed or only some browsers will work properly. At this time, you usually need to do the following steps: Confirm whether the modified style file is the style file of the current page (in the case of multiple environments) Confirm that the path in the file is correct (maybe you wrote too much or too little by mistake) If both of the above points are confirmed to be ok or only part of the styles are invalid, it can be basically determined that it is a problem with the file encoding. Everyone knows that using "UTF-8" is more cross-platform compatible than "GB2312", but they may not know that the file encoding and the file encoding declaration are not the same thing. They think that as long as the file encoding type is declared, the file encoding is changed. As a result, many times the file encoding type is simply declared, but the file encoding type is not actually changed. When the browser parses the file with the declared encoding type, the actual encoding of the file is different from the declaration, resulting in incorrect parsing. How do the above problems arise? Only the declaration was modified, and the file encoding type corresponding to the declaration was not saved. When copying between different files, the encodings of the two files are different. The above problem can be solved by saving another copy and selecting the same encoding type as the declaration. If the above methods do not work, it may be a problem with the editing software. It is recommended to try another editor. The editors I know of that may have problems are: EmEditor Professional v7.50 Alpha 5 (Maybe it's due to the Alpha version. When UTF-8 is not signed, if there are specific Chinese characters at the end of the style comment, such as "不、用、接、名、近、见、鬼、评、论、的、出、写、下、现、面、日", the subsequent content cannot be parsed by IE7) Editplus (I don't know which version it is. If anyone knows please tell me. When saving UTF-8 and adding a signature, the signature will cause the content to be unable to be parsed) Note: The above refers to the style part, including the style in the page and the independent style file. |
<<: Node.js returns different data according to different request paths.
>>: How to migrate the data directory in mysql8.0.20
■ Website theme planning Be careful not to make yo...
1. Install Fcitx input framework Related dependen...
1. Get the mysql image docker pull mysql:5.6 Note...
Table of contents Inheritance ES5 prototype inher...
The following is an introduction to using SQL que...
Table of contents 1. Default values for functio...
The following HTML tags basically include all exis...
Set Tomcat to automatically start the service: I ...
Table of contents Preface Introduction-Official E...
This article will introduce how to use radial-gra...
Table of contents 1. Enter the network card confi...
Table of contents 1. What is 2. Use Numeric Enume...
To improve processing power and concurrency, Web ...
This article will discuss these 4 principles as t...
Table of contents Preface 1. Install Docker 2. In...