解码用这种方式:name = new String(name.getBytes("ISO-8859-1"),"UTF-8");
实在不行的话,换POST提交看看
name = new String(name.getBytes("ISO-8859-1"),"UTF-8"); 这个如果是GET提交的话无效的
无码无真相。myEclipse很强大,debug帮到你。
可能是下载头文件设置有问题,不知道楼主和我用的是否一样,参照这个看看。response.setHeader("Content-Disposition","attachment;filename=" + new String(("suspendAccountDetails "+dateStr+".xls").getBytes(),"ISO8859_1"));
这个如果是GET提交的话无效的
<Connector port=”8080″ protocol=”HTTP/1.1″ connectionTimeout=”20000″ redirectPort=”8443″ URIEncoding=”UTF-8″ />因为浏览器get发送请求时会用utf-8编码,如果tomcat不是就会中文乱码。