</pre><p>我使用的是MyEclipse10工具,新建了一个html5文件,编写代码如下:</p><p>login.htm</p><p><pre name="code" class="html"><!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>-->
<h1>登陆操作</h1><hr>
<form action="login_check.jsp" method="post">
<table border="1">
<tr>
<td colspan="2">用户登陆</td>
</tr>
<tr>
<td>登陆ID:</td>
<td><input type="text" name="id"></td>
</tr>
<tr>
<td>登陆密码:</td>
<td><input type="password" name="password"></td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="登陆">
<input type="reset" value="重置">
</td>
</tr>
</table>
</form>
</body>
</html>
然后在google浏览器上打开,结果如下图所示,中文全是乱码:
<img src="https://img-blog.csdn.net/20151109192226804?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" style="font-family: Arial, Helvetica, sans-serif;" alt="" />
问题的解决:
我的html代码中content="text/html; charset=UTF-8,将UTF-8改为GBK,就解决问题了