使用POI导出Excel,文件名中文乱码:
String fileName = "_费率-" + DateUtil.DateToStr(new Date());
response.setCharacterEncoding("UTF-8");
response.setContentType("application/vnd.ms-excel");
response.setHeader("content-disposition",
"attachment;filename=" +
new String(fileName.getBytes("utf-8"),"ISO-8859-1" )+ ".xls");
尝试解决方案:
fileName = URLEncoder.encode(fileName, "UTF-8");
fileName = new String(this.fileName.getBytes("utf-8"),"ISO-8859-1");