Created
October 21, 2019 11:33
-
-
Save codethereforam/65ed28449a18a8d1bd3090958fdc7be4 to your computer and use it in GitHub Desktop.
Java导出文件名含中文乱码解决
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
response.setContentType("text/plain; charset=UTF-8"); | |
String encodedFileName = new String("中文".getBytes(), StandardCharsets.ISO_8859_1); | |
response.addHeader("Content-Disposition","attachment; filename=" + encodedFileName); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment