将工程从WINDOWS迁移到AIX系统下时,导出乱码
将工程从WINDOWS迁移到AIX系统下时,导出中文显示乱码
调试测试半天终于解决
方法如下:
将提交导出JSP的地方包含有中文,用encodeURI 进行编码
document.exportForm.exportData.value=encodeURI(document.getElementById(temp).innerHTML);
提交到导出jsp的页面。
在导出JSP的页面修改:
String dataInfo = request.getParameter(“exportData”);
try {
dataInfo=URLDecoder.decode(dataInfo ,”ISO-8859-1″);
} catch (Exception e) {
e.printStackTrace();
}
且 dataInfo = “<html><head></head><body>”
+ dataInfo + “</body></html>”;
不需要包含<meta>标签的页面编码