很简单,将文件名程进行编码处理即可

String fileName = new String(" 人员统计.xlsx".getBytes("utf-8"), "ISO-8859-1");
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
很简单,将文件名程进行编码处理即可
String fileName = new String(" 人员统计.xlsx".getBytes("utf-8"), "ISO-8859-1");
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
本文标题:《Java 下载文件中文不显示问题解决》作者:极四维博客
原文链接:http://cway.top/post/907.html
特别注明外均为原创,转载请注明。
扫描二维码
可在微信查看或分享至朋友圈。
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。