设置编码应写成:
response.setHeader("Content-disposition", "attachment;filename="+new String(fileName.getBytes("GBK"),"ISO8859-1"));
注意:文件名中必须为中文的输入法,比如“用户信息-市级管理,区级管理.xls”逗号要写成中文的才可以,
如果写成“用户信息-市级管理,区级管理.xls”逗号是英文的,那么后面的“区级管理”就会编程乱码。
设置编码应写成:
response.setHeader("Content-disposition", "attachment;filename="+new String(fileName.getBytes("GBK"),"ISO8859-1"));
注意:文件名中必须为中文的输入法,比如“用户信息-市级管理,区级管理.xls”逗号要写成中文的才可以,
如果写成“用户信息-市级管理,区级管理.xls”逗号是英文的,那么后面的“区级管理”就会编程乱码。