user3014926
user3014926

Reputation: 1099

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?

Upvotes: 16

Views: 70432

Answers (4)

Justin Chan
Justin Chan

Reputation: 21

use utf-8 character set otherwise it will all be code remember <meta charset="utf-8"

Upvotes: 2

Eliezer Bernart
Eliezer Bernart

Reputation: 2426

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.

Upvotes: 21

rulebot
rulebot

Reputation: 232

Make sure to use UTF-8 or a comparable encoding. This can be made sure in the http headers:

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

Upvotes: 3

Choppin Broccoli
Choppin Broccoli

Reputation: 3076

Ensure you are using the UTF-8 character set

Upvotes: 1

Related Questions