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 ......).