需要將指定字符串的編碼轉換成瀏覽器里面的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"));