Home > Web Front-end > Front-end Q&A > What to do if the Chinese characters in the html file are garbled

What to do if the Chinese characters in the html file are garbled

藏色散人
Release: 2023-01-05 16:12:09
Original
16111 people have browsed it

Solution to the Chinese garbled html file: First open the garbled HTML file; then add a line of statement "" is enough.

What to do if the Chinese characters in the html file are garbled

The operating environment of this article: windows7 system, HTML5&&CSS3 version, DELL G3 computer.

Solution to the problem of Chinese html files displaying garbled characters in the browser

When using a browser to open an html file, Chinese characters display garbled characters. The following is the content of the original file

<html>
     <head>
       <title>狗熊王</title>
     </head>
  
    <body>
         <p>狗熊王</p>
      <p>http://blog.csdn.net/mybelief321</p>
     </body>
 </html>
Copy after login

Garbled characters appear

Added a line , as follows

<html>
      <meta http-equiv="Content-Type"content="text/html;charset=utf-8">
         <head>
           <title>狗熊王</title>
        </head>
 <body>
          <p>狗熊王</p>
         <p>http://blog.csdn.net/mybelief321</p>
        </body>
 </html>
Copy after login

No more garbled characters at this time

The following is the information to be found:

   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <meta http-equiv="Content-Language" content="zh-CN" />
   <meta name="author" content="Csdn" />
 <meta name="Copyright" content="Csdn" />
   <meta name="description" content="" />
   <meta content="" name="keywords" />
Copy after login

The first line explains his text encoding

The second line Describes the language he uses

The third line explains his author

The fourth line explains his copyright

The fifth line is a brief description of the website

The sixth line explains the keywords of this website

The following two lines are mainly used when being retrieved by search sites such as Baidu. They are very important

[Recommended learning:HTML video tutorial

The above is the detailed content of What to do if the Chinese characters in the html file are garbled. 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