这样的中文问题谁遇到过,该如何解决
这样的中文问题谁遇到过,该如何解决
楼主ch89(有一种语言叫JAVA)2004-02-28 15:22:33 在 Java / Web 开发 提问 test1.jsp
<%@ page contentType="text/html; charset=UTF-8" %>
<html>
<head>
<title>
test1
</title>
</head>
<body bgcolor="#ffffff">
<form action="test2.jsp" method="get">
<input type="hidden" name="test" value="中文">
<input type="submit" name="ok" value="ok">
</form>
</body>
</html>
test2.jsp
<%@ page contentType="text/html; charset=UTF-8" %>
<html>
<head>
<title>
test2
</title>
</head>
<body bgcolor="#ffffff">
<%
request.setCharacterEncoding("UTF-8");
String test = request.getParameter("test");
out.println(test);
%>
<jsp:forward page="test3.jsp">
<jsp:param name="test" value="<%=test%>"/>
</jsp:forward>
</body>
</html>
这时候输出正确是正确的字符串“中文”
test3.jsp
<%@ page contentType="text/html; charset=UTF-8" %>
<html>
<head>
<title>
test3
</title>
</head>
<body bgcolor="#ffffff">
<%
request.setCharacterEncoding("UTF-8");
String test = request.getParameter("test");
out.println(test);
%>
</body>
</html>
输出就变成"-?"这样的乱码了
如何解决这种问题 问题点数:20、回复次数:4Top
-
相关文章
2秒记住本站域名
玩过泡泡龙吗?Readygo?Go! 再加上.Com.Cn的后缀,那就是大名小顶的readygo.com.cn
