Recently, many students have asked me about coding questions on web pages. What is the difference between gb2312 and utf-8 coding? Let’s summarize today.
Recently, many students have asked me about coding questions on web pages. What is the difference between gb2312 and utf-8 coding? To summarize today:
I don’t know if you will encounter the problem that the style definition does not take effect when making a page. The basic manifestation is that no style is displayed or only some browsers are normal. At this time, the following steps are usually required:
Confirm whether the modified style file is the style file of the current page (in case of multiple environments)
Confirm whether the path in the file is correct (maybe mistaken and write more or less)
If both points above confirm that there is no problem or only some of the styles are invalid, you can basically confirm that it is a file encoding problem
Everyone knows that using UTF-8 is better cross-platform compatibility than GB2312, but they don’t necessarily know that the encoding of the file is not the same as the declaration of the file encoding. They think that as long as the encoding type of the file is declared, the encoding of the file is changed, which leads to the simple declaration of the file encoding type, and the file encoding type is not really modified. When the browser parses the file with the declared encoding type, the actual encoding of the file is different from the declaration, the problem of incorrect parsing occurs.
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 encoding between the two files is different
Just save another copy of the above problem and select the same encoding type as the declaration.
If none of the above methods work, it may be a problem with the editing software. It is recommended to try a different editor.
Currently I know the editor that will have problems:
EmEditor Professional v7.50 Alpha 5 (maybe it is the relationship of the Alpha version. When UTF-8 is not signed, if specific Chinese appears at the end of the style comment, such as not, use, connect, name, close, see, ghost, comment, comment, comment, output, write, down, present, face, day, etc., the subsequent content will not be parsed by IE7)
Editplus (I don’t know which version it is. If anyone knows, please tell me that when saving UTF-8 plus signature, the signature will cause the content to be parsed)
Note: The above all refer to the style part, including the styles in the page and independent style files.