蓝森林首页 | 返回主页 | 本站地图 | 站内搜索 | 联系信箱 |
 您目前的位置:首页 > 自由软件 > 技术交流 > 应用编程


    

蓝森林 http://www.lslnet.com 2006年6月6日 10:18


急救:用request.getParameter()提取汉字数据,为什么是乱码?

我从表单输入的数据是汉字的,可是在用request.getParameter()提取该数据时,得到的确实乱码?不知道是怎么回事?请哪位大侠指教,多谢! :?:

急救:用request.getParameter()提取汉字数据,为什么是乱码?

用这种方法转一下试

c=new String(request.getParameter("c").getBytes("iso8859_1"),"gb2312");

急救:用request.getParameter()提取汉字数据,为什么是乱码?

楼上的,这句话有错误!

急救:用request.getParameter()提取汉字数据,为什么是乱码?

-->     

这样的事尽量少做 :(

急救:用request.getParameter()提取汉字数据,为什么是乱码?

用setCharacterencoding也不行么?

急救:用request.getParameter()提取汉字数据,为什么是乱码?

在用request对象之前,设置它的字符集,具体是什么我忘记了,
如果你用的是dreamweaver mx的话,你先打入"request." ,等一下它就会出来的。

急救:用request.getParameter()提取汉字数据,为什么是乱码?

这个好像和平台有关系的,我用过weblogic上面一般没有这样的问题,tomcat就一定要经过一次转换

急救:用request.getParameter()提取汉字数据,为什么是乱码?

使用 Filter 来解决中文的问题吧,看置顶的 FAQ



Copyright © 1999-2000 LSLNET.COM. All rights reserved. 蓝森林网站 版权所有。 E-mail : webmaster@lslnet.com