jxl导出EXCEL文件名称乱码

开始导出excle时名称是乱码的,加上下面的就可以了,

String FileNam="xx医院_xxxx_xx_xx.xls";

res.setCharacterEncoding("UTF-8");
res.setContentType("application/octet-stream");
String fileName_1 = new String(FileName.getBytes("UTF-8"), "iso8859-1");
res.setHeader("Content-Disposition", "attachment;filename=" + fileName_1);

posted @ 2017-06-28 09:07  黑土浊墨悟吾心  阅读(220)  评论(0编辑  收藏  举报