需要将指定字符串的编码转换成浏览器里面的ISO-8859-1编码
String name = new String(name.getBtes("utf-8"),"ISO-8859-1");
示例:
response.setContentType("application/octet-stream"); response.setHeader("content-disposition", "attachement;filename=" + new String(fileInfo.getFileName().getBytes("utf-8"), "ISO-8859-1"));