我已配置好eclipse+tomcat+lomboz环境,用写字板写了一个如下
<%@ page language= "java " contentType= "text/html; charset=gb2312 "
pageEncoding= "gb2312 "%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN " "http://www.w3.org/TR/html4/loose.dtd ">
<html>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=ISO-8859-1 ">
<title> Insert title here </title>
</head>
<body>
"Content-Type wei da de 伟大 "
</body>
</html>
在 eclipse+tomcat+lomboz 里打开运行无乱码
但是我只要在eclipse里面保存在eclipse里面看无乱码,这时在 eclipse+tomcat+lomboz 里打开运行显示乱码,再用写字板打开变成如下了:
<%@ page language= "java " contentType= "text/html; charset=gb2312 "
pageEncoding= "gb2312 "%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN " "http://www.w3.org/TR/html4/loose.dtd ">
<html>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=ISO-8859-1 ">
<title> Insert title here </title>
</head>
<body>
"Content-Type wei da de 浼熷ぇ "
</body>
</html>
------解决方案--------------------
<meta http-equiv= "Content-Type " content= "text/html; charset=ISO-8859-1 ">
后面的“ISO-8859-1”改为“gb2312”先看看;
或者再看一下window -> preferences -> web and xml -> jsp files ,这里是设置文字格式。
------解决方案--------------------
乱码无非就是3个地方:
<%@ page contentType= "text/html; charset=gb2312 "%>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
还有一个地方就复杂了,
你先看看这两句话加上去有没有效果吧
------解决方案--------------------
GBK