100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > 解决导出excel文件名中文乱码的问题

解决导出excel文件名中文乱码的问题

时间:2023-05-16 01:45:55

相关推荐

解决导出excel文件名中文乱码的问题

设置响应头文件名称编码

URLEncoder.encode(fileName, "UTF-8")

String fileName = "工作任务办理单";//输出Excel文件OutputStream output = response.getOutputStream();response.reset();//设置响应头response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".xls");response.setContentType("application/x-xls");wb.write(output);output.close();

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。