解决方案1
String codedFileName = "导出文件名.xls";String agent = request.getHeader("USER-AGENT"); if(agent != null && agent.toLowerCase().indexOf("firefox") > 0) { codedFileName = "=?UTF-8?B?" + (new String(Base64Utils.encodeToString(codedFileName.getBytes("UTF-8")))) + "?="; } else { codedFileName = java.net.URLEncoder.encode(codedFileName, "UTF-8"); }response.setHeader("Content-Disposition", "attachment;filename=" + codedFileName);
解决方案2
response.setHeader("Content-Disposition", "attachment;filename*=utf-8'zh_cn'" + codedFileName);