当前位置:网站首页>解决导出excel文件名中文乱码的问题
解决导出excel文件名中文乱码的问题
2022-08-02 11:39:00 【sinat_36279113】
设置响应头文件名称编码
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();
边栏推荐
猜你喜欢
随机推荐
面积曲线AUC(area under curve)
Create your own app applet ecosystem with applet containers
Breaking the Boundary, Huawei's Storage Journey
Deep Learning 100 Examples - Convolutional Neural Network (CNN) for mnist handwritten digit recognition
npm WARN config global `--global`, `--local` are deprecated. Use `--location解决方案
sva assertion data
Excel动态图制作
如何通过DBeaver 连接 TDengine?
打破千篇一律,DIY属于自己独一无二的商城
Learning Experience Sharing Seven: YOLOv5 Code Chinese Comments
[kali-information collection] (1.9) Metasploit + search engine tool Shodan
【Acunetix-忘记密码】
Oracle 单实例19.11升级到19.12
SQL(面试实战07)
雷克萨斯,锁死的安全,挡不住的心寒
AdguardHome如何配置设置?我的AdguardHome配置内容过滤器拦截列表
Shell编程之条件语句
AlphaFold又放大招,剑指整个生物界!
中原银行实时风控体系建设实践
When not to use () instead of Void in Swift