为什么是乱码啊 不明白啊。。。

yuallen 2006-12-25 08:48:30
<%@ page contentType="text/html;charset=GB2312" %>
<%request.setCharacterEncoding("GB2312");%>
<body>
<%=request.getParameter("name")%>
<form name="form" action="c.jsp" method="get" >
<p>姓名:<input type="text" name="name"></p>
<p> <input type="submit" value="提交">
<input type="reset" value="取消">
</p>
</form>
<body>
提交中文后为什么是乱码啊 没道理啊。。。
...全文
147 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
brain0728 2006-12-26
  • 打赏
  • 举报
回复
转码问题~~~我也碰到过~~~而楼的办法可行~~~
yuallen 2006-12-26
  • 打赏
  • 举报
回复
<%request.setCharacterEncoding("GB2312");%>
这个语句不是可以在接受的时候转码吗???
yuallen 2006-12-26
  • 打赏
  • 举报
回复
<%@page pageEncoding="GB2312"%>
<%@page contentType="text/html; charset=gb2312"%>
<%request.setCharacterEncoding("GB2312");%>
我看见几本书上都说 有这三条就够了
gzlaspnet 2006-12-25
  • 打赏
  • 举报
回复
试一下。我也想知道这个问题。
huguangwu 2006-12-25
  • 打赏
  • 举报
回复
<%out.println(new String(request.getParameter("name").getByte("iso8859-1"),"GB2312")%>
syhan 2006-12-25
  • 打赏
  • 举报
回复
要转一下码

81,092

社区成员

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

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