原先:
response.setHeader("Content-Disposition", "attachment; filename=中文.pdf");
这个回到中传到前端的时候出现乱码
解决办法:使用encode
response.setHeader("Content-Disposition", "attachment; filename=" + java.net.URLEncoder.encode("中文.pdf", "UTF-8"));
前端:decode
原先:
response.setHeader("Content-Disposition", "attachment; filename=中文.pdf");
这个回到中传到前端的时候出现乱码
解决办法:使用encode
response.setHeader("Content-Disposition", "attachment; filename=" + java.net.URLEncoder.encode("中文.pdf", "UTF-8"));
前端:decode