How to display Chinese character in HTML

I created a webpage using Chinese. When I browse the page using Google chrome, all Chinese characters are damaged. Do I need to add something to the HTML page?

+6
source share
3 answers

There are two ways to determine the encoding of your page. You must include an encoding tag in your <head> tag, two ways to do it below:

Shortcut:

 <meta charset="utf-8"> 

A long way:

 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 

You can get more details about the difference between the two methods in this question:

If you want to see a real example, look at weibo.com source code in this line of code .

+7
source

Be sure to use UTF-8 or comparable encoding. This can be done in the http headers:

 Content-Type: text/html; charset=utf-8 
+1
source

Make sure you use the UTF-8 character set

0
source

All Articles