JSP页面字符集的奇怪问题?
Tomcat下用JSP,我已经在 <meta标签中指明了字符集,但是IE中总是出现乱码,非要手工设置IE的字符集为“简体中文”才能正常浏览?
<html>
<head>
<META http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
</head>
<body>
<%
session.setAttribute( "userID ", "1000 ");
String UserID=session.getAttribute( "userID ").toString();
%>
<a href= "http://135.35.6.149/dl/b.aspx?userid= <%out.println(UserID);%> "> 转到B系统导入报表 </a>
</body>
</html>
------解决方案--------------------在最前面加上:
<%@ page contentType= "text/html;charset=gb2312 "%>
这样:
<%@ page contentType= "text/html;charset=gb2312 "%>
<html>
<head>
<META http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
</head>
<body>
<%
session.setAttribute( "userID ", "1000 ");
String UserID=session.getAttribute( "userID ").toString();
%>
<a href= "http://135.35.6.149/dl/b.aspx?userid= <%out.println(UserID);%> "> 转到B系统导入报表 </a>
</body>
</html>