response下载框名字乱码的问题呀 在线等~~~~~
用response谈出下载框,可下载框上的下载文件的名字用英文就没有问题,换成中文或是日文就会乱码,这个问题怎么解决呀???
首先要日文的不乱码,其次中文的,应该怎么解决呢?
代码:
response.setContentType( "application/vnd.ms-excel; ");
response.setHeader( "Content-Disposition ", "attachment; filename= " + "test.xls ");
------解决方案--------------------response.setHeader( "Content-Disposition ", "attachment; filename= " + URLEncoder.encode( "test.xls ", "UTF-8 "));
------解决方案--------------------waerrwrwrwrwwrw
------解决方案--------------------楼主.能看看是如何设置响应头吗.. 我在做下载文件时.. 老是用IE给直接打开了..
------解决方案--------------------response.setCharacterEncoding( "GBK ");
response.setContentType( "application/doc ");
response.setHeader( "Content-disposition ", "attachment; filename=\ " "
+ URLEncoder.encode(文件名, "UTF-8 ") + "\ " ");