发现搜到的全部一样的方案 new String(fileName.getBytes(), "ISO8859-1")
贴一个不一样的解决方案
使用URLEncoder.encode
String attachName = "这是中文名称文件.txt"//https://www.cnblogs.com/tomcatandjerry/p/11541871.html
response.setCharacterEncoding("utf-8"); response.setContentType("application/octet-stream"); response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(attachName, "UTF-8"));