Today a junior student asked a question. The HTML code he wrote displayed garbled characters when opened. Then they sent me the code. It’s just an HTML file and a folder. When you open it, you can see very simple code. <!DOCTYPE html> <html lang=""> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Personal Introduction</title> </head> <body> <h6>Introduce yourself</h6><br> <h4>Name</h4><br> It's better to say that your name is mine<br> <h4>Good job</h4><br> Traveling is fun<br> The game is good<br> <h4>Birthplace Introduction</h4><br> I'm from Sichuan. Sichuan has many mountains and Sichuan people are friendly and hospitable. Sichuan people are very fond of spicy food. <hr> <h4>Dream of the Future</h4><br> It's like an excellent programmer. <hr> <a href="hobby/myhobby.html">It's just like having your own hobbies. </a> </body> </html> Since I am a student majoring in Sino-Japanese Studies, many of the content is in Japanese. When I open it with a browser, it looks like this: In short, it's just garbled code and I can't understand anything. The garbled characters must be a problem with the encoding method, but the code has indicated that UTF-8 encoding is used, so why is there still garbled characters? Please note that it can be displayed normally when I open it with Notepad, but it is garbled when opened through the browser. This is because the encoding method of Notepad is ANSI, not UTF-8, which is different from what we wrote in the code. So we need to unify the encoding method. That is: Then reopen it and it will display normally. This is the end of this article about the garbled code problem caused by HTML encoding problems. For more related html garbled code problem content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! |
<<: MySQL character types are case sensitive
We all know that the commonly used positioning me...
Table of contents Preface Lua Script nignx.conf c...
Copy code The code is as follows: <head> &l...
The world-famous virtual machine software VMware-...
Windows Server 2008 server automatically restarts...
vue-cli uses stimulsoft.reports.js (nanny-level t...
Preface By default, Nginx logs are written to a f...
Basic Concepts By default, Compose creates a netw...
Table of contents 1. Introduction 2. Usage Statel...
view: Views in MySQL have many similarities with ...
I have always wanted to learn about caching. Afte...
Table of contents 1. What is copy_{to,from}_user(...
1. Add Maria source vi /etc/yum.repos.d/MariaDB.r...
Login + sessionStorage Effect display After a suc...
A composite index (also called a joint index) is ...