Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
968 views
in Technique[技术] by (71.8m points)

how to display chinese character in HTML

I have created web page using Chinese. When I view the page with Google chrome, all Chinese characters are corrupted. Do I have to add something in HTML page?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There are two ways to define the encoding of your page. You should include inside your <head> tags an encoding tag, two ways to do that follow below:

Short way:

<meta charset="utf-8"> 

Long way:

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

You can have more details about the difference between these two ways in this question:

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...