Chinese Garbled text

Source: Internet
Author: User

Chinese Garbled text

Today, I encountered Chinese garbled Characters During HTML5 learning:

<Body> <form> enter the following content: <input pattern = "[A-Z] {3}" name = "part"> <input type = "submit"> </form> </body>

I developed it using myeclipse 2016, but the encoding formats of my project and html files are UTF-8 or garbled. I did not find it on the Internet, later I found an interesting thing and learned the cause of the problem.

Each time you create a new HTML5 file, the new file comes with the following code:

 <meta name="keywords" content="keyword1,keyword2,keyword3"> <meta name="description" content="this is my page"> <meta name="content-type" content="text/html; charset=UTF-8">

But when I try

 <meta name="content-type" content="text/html; charset=UTF-8">

Change to the following:

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

The garbled problem is solved.

Then I googled the differences between http-equiv and name:

They say this: "The name attribute is mainly used to describe the webpage", while http-equiv "is equivalent to the http File Header, which can return some useful information to the browser, to help display the webpage content correctly and accurately."

--- Reference URL: http://blog.itpub.net/28699126/viewspace-1384326/

I want to make it clear here, but it may need to be changed every time in future development (I tried to delete all these meta attributes. When the project starts running, or Chinese garbled characters ......).

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.