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
This article example shares the specific code of ...
Table of contents 1. Transition from development ...
1. Database transactions will reduce database per...
1. Packaging Vue project Enter the following name...
Preface There are many open source monitoring too...
Preface The reason for writing this article is mai...
Preface In case of application bug or DBA misoper...
Sometimes when requesting certain interfaces, you...
Related reading: MySQL8.0.20 installation tutoria...
Requirement: Celery is introduced in Django. When...
The Docker Hub we used earlier is provided by Doc...
The title images on Zhihu Discovery columns are g...
This article example shares the specific code of ...
CSS CodeCopy content to clipboard .bottomTable{ b...
Crontab is a command used to set up periodic exec...