为什么html出来的页面中文是乱码的??这是为什么 代码如下
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- DW6 -->
<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<title>Home Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="stylesheet" href="mm_health_nutr.css" type="text/css" />
<script language="JavaScript" type="text/javascript">
//--------------- LOCALIZEABLE GLOBALS ---------------
var d=new Date();
var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
//Ensure correct for language. English is "January 1, 2004"
var TODAY = monthname[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear();
//--------------- END LOCALIZEABLE ---------------
</script>
</head>
<body bgcolor="#F4FFE4">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#D5EDB3">
<td width="382" colspan="3" rowspan="2"><img src="mm_health_photo.jpg" alt="为什么html出来的页面中文是乱码的?这是为什么 代码如上" width="382" height="101" border="0" /></td>
<td width="378" height="50" colspan="3" id="logo" valign="bottom" align="center" nowrap="nowrap">网上订餐</td>
<td width="100%"> </td>
</tr>
<tr bgcolor="#D5EDB3">
<td height="51" colspan="3" id="tagline" valign="top" align="center">OPTIONAL TAGLINE HERE</td>
<td width="100%"> </td>
</tr>
<tr>
<td colspan="7" bgcolor="#5C743D"><img src="mm_spacer.gif" alt="为什么html出来的页面中文是乱码的?这是为什么 代码如上" width="1" height="2" border="0" /></td>
</tr>
<tr>
<td colspan="7" bgcolor="#99CC66" background="mm_dashed_line.gif"><img src="mm_dashed_line.gif" alt="为什么html出来的页面中文是乱码的?这是为什么 代码如上" width="4" height="3" border="0" /></td>
</tr>
<tr bgcolor="#99CC66">
<td colspan="7" id="dateformat" height="20"> <script language="JavaScript" type="text/javascript">
document.write(TODAY);</script></td>
</tr>
<tr>
<td colspan="7" bgcolor="#99CC66" background="mm_dashed_line.gif"><img src="mm_dashed_line.gif" alt="为什么html出来的页面中文是乱码的?这是为什么 代码如上" width="4" height="3" border="0" /></td>
</tr>
<tr>
<td colspan="7" bgcolor="#5C743D"><img src="mm_spacer.gif" alt="为什么html出来的页面中文是乱码的?这是为什么 代码如上" width="1" height="2" border="0" /></td>
</tr>
<tr>
<td width="165" valign="top" bgcolor="#5C743D">
<table border="0" cellspacing="0" cellpadding="0" width="165" id="navigation">
<tr>
<td width="165"> <br />
<br /></td>
</tr>
<tr>
<td width="165"><a href="#" onClick="javascript:window.open('login.jsp','','height=500,width=611,scrollbars=yes,status =yes')"class="navText">adminlogin</a></td>
</tr>
<tr>
<td width="165"><a href="#" onClick="javascript:window.open('qiantai/default.jsp','','height=500,width=611,scrollbars=yes,status =yes')"class="navText">bbs</a></td>
</tr>
<tr>
<td width="165"><a href="javascript:;" class="navText">educators</a></td>
</tr>
<tr>
<td width="165"><a href="javascript:;" class="navText">special needs</a></td>
</tr>
<tr>
<td width="165"><a href="javascript:;" class="navText">food science</a></td>
</tr>
</table>
?<br />
<br />
<br />
<br /> </td>
<td width="50"><img src="mm_spacer.gif" alt="为什么html出来的页面中文是乱码的?这是为什么 代码如上" width="50" height="1" border="0" /></td>
<td width="305" colspan="2" valign="top"><img src="mm_spacer.gif" alt="为什么html出来的页面中文是乱码的?这是为什么 代码如上" width="305" height="1" border="0" /><br />
<br />
<br />
<table border="0" cellspacing="0" cellpadding="0" width="305">
<tr>
<td class="pageName">WELCOME MESSAGE</td>
</tr>
<tr>
<td class="bodyText">本网站适用于本校学生</td>
</tr>
</table>
?<br />
<br /></td>
<td width="50"><img src="mm_spacer.gif" alt="为什么html出来的页面中文是乱码的?这是为什么 代码如上" width="50" height="1" border="0" /></td>
<td width="190" valign="top"><br />
<br />
<table border="0" cellspacing="0" cellpadding="0" width="190" id="leftcol">
<tr>
<td width="10"><img src="mm_spacer.gif" alt="为什么html出来的页面中文是乱码的?这是为什么 代码如上" width="10" height="1" border="0" /></td>
<td width="170" class="smallText"><br />
<p><span class="subHeader">引言</span><br />
欢迎光临</p>
<p><span class="subHeader">标签</span><br />美味<br />
</p>
<p><span class="subHeader">地址</span><br />
后街</p>
?<br />
<br /> </td>
<td width="10"> </td>
</tr>
</table></td>
<td width="100%"> </td>
</tr>
<tr>
<td width="165"> </td>
<td width="50"> </td>
<td width="167"> </td>
<td width="138"> </td>
<td width="50"> </td>
<td width="190"> </td>
<td width="100%"> </td>
</tr>
</table>
</body>
</html>
[解决办法]
除了charset=gb2312外,html文件本身的编码是不是与字符集一致?
记事本打开文件,菜单选文件-另存为 在弹出的对话框中看编码是什么?
[解决办法]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />