各位请关注:在另外一个页面显示为乱码的问题

frankh2002 2003-10-21 09:28:54
本人搜索以前的关于这个问题的帖子,都没有得到解决~~~
大家可以拿这个例子去你们的服务器上去测试
-----------------------------------------------------------------
test.jsp
<%@ page contentType="text/html;charset=GB2312" %>
<html>
<body>
<%
String temp=request.getParameter("name");
out.println(temp);
%>
</body>
</html>
---------------------------------------------------------
zhongwen.jsp
<%@ page contentType="text/html; charset=gb2312" %>
<jsp:include page="test.jsp">
<jsp:param name="name" value="中文"/>
</jsp:include>
-------------------------------------------------------
运行zhongwen.jsp,在浏览器中输出的是:涓????
-----------------------------------------------------
服务器的配置为:linux+jsk1.4+resin-2.1.*
...全文
106 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
wweijie 2004-03-04
  • 打赏
  • 举报
回复
mark
winown 2003-12-30
  • 打赏
  • 举报
回复
String temp= request.getParameter("name");
temp=new String(temp.getBytes("8859_1"),"GBK");

写错了,呵呵
winown 2003-12-30
  • 打赏
  • 举报
回复
String temp= request.getParameter("name");
temp=new String(customerName.getBytes("8859_1"),"GBK");
对字符集做一下转换。
whodsow 2003-12-29
  • 打赏
  • 举报
回复
http://www.csdn.net/develop/read_article.asp?id=21757
iDay 2003-12-29
  • 打赏
  • 举报
回复
String temp=new String(request.getParameter("name").getBytes("ISO-8819-1"),"GB2312");
weichunhua 2003-12-29
  • 打赏
  • 举报
回复
关注~~,我也遇到了
weichenggao 2003-10-27
  • 打赏
  • 举报
回复
哎呀,我也遇到这样的问题,正头痛呢?
String temp=(request.getParameter("sum")!=null?request.getParameter("sum"):"");
out.print("temp="+temp);
if(temp.equals("最後")) out.print("gaoji");
%>
<form action="" name="form1" method="post">
<input type="text" name="sum" value="最後">
<input type="submit" name="submit" value="submit">
</form>
打印出来的就是乱码!那位大狭帮着一起看看吧!谢谢拉

81,091

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧