使用jxl进行导出excel时,发现导出的文件名如果是中文,会出现乱码问题,将文件名进行如下编码后即可解决
String fileName="补充类型网站人员工作量考核表.xls";
response.setContentType("application/octet-stream");
response.addHeader("content-type", "application/x-msdownload;");
response.setHeader("Content-disposition", "attachment; filename="+ new String(fileName.getBytes("gb2312"),"ISO8859-1"));
网友评论