MyEclipse中新建html5中文乱码

近期刚开始入门html5 和 javascript

用MyEclipse2104创建html5时,遇到浏览器显示中文乱码的问题

[MyEclipse中设置的html5,jsp编码都采用的UTF-8] 

[html5文档中设置的浏览器解码格式采用的UTF-8]

内容如下:

<!DOCTYPE html>
<html>
  <head>
    <title>测试</title>
    
    <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">
    
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->

  </head>
  
  <body>
    This is my HTML page. 您好 <br>
    
    <script>alert(document.title);</script> <br>

  </body>
</html>

浏览器中显示中文乱码

网上刚好找到类似的问题及解答,参见源

解决方法一:

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

解决方法二:

  添加 <meta charset="UTF-8">

原文地址:https://www.cnblogs.com/leenice/p/5230305.html