15

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?

user3014926
  • 1,061
  • 7
  • 18
  • 26
  • As the answers said, it's highly recommended to use `utf-8` as your document's character set, but you should not forget to also change your file's encoding to `UTF-8` – php_nub_qq Dec 18 '13 at 22:49
  • Read this! https://www.inventpartners.com/news/chinese-chars – Echeban Apr 26 '23 at 11:30

4 Answers4

20

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.

Community
  • 1
  • 1
Eliezer Bernart
  • 2,386
  • 24
  • 33
3

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
rulebot
  • 232
  • 3
  • 7
2

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

1

Ensure you are using the UTF-8 character set

Choppin Broccoli
  • 3,048
  • 2
  • 21
  • 28