Struts 2 type="stream" 中文filename如何正常显示
2013-04-19 16:13
274 查看
uploadFileName = java.net.URLDecoder.decode(uploadFileName,"ISO8859-1");
<result name="downLoadFile" type="stream">
<param name="inputName">inputStream</param>
<param name="contentType">${uploadContentType}</param>
<param name="contentDisposition">attachment;filename=${uploadFileName}</param>
<param name="bufferSize">1024</param>
</result>
貌似
java.net.URLDecoder.decode(uploadFileName,"ISO8859-1");
必须写ISO8859-1
我试了UTF-8不行就不行。
而<param name="contentType">${uploadContentType}</param>加不加charset="ISO8859-1";不影响乱码
甚至写成
uploadFileName = java.net.URLDecoder.decode(uploadFileName,"ISO8859-1");
<param name="contentType">${uploadContentType};charset="UTF-8"</param>
相关文章推荐
- [转载]centos 6.4中git如何正常显示中文
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">设置中文显示
- linux "VI编辑器"如何显示中文?
- 如何在windows的DOS窗口中正常显示中文(UTF-8字符)
- input type="file" 显示的中文怎么改成英文的方法
- utf-8编码的中文字符在source in sight如何正常显示
- 使用response.setHeader("Content-Disposition","attachment;filename="+fName)下载文件,中文文件名无法显示的问题
- source-insight中文:utf-8编码的中文字符在source in sight如何正常显示
- 日本系统开发下如何正常显示中文
- 解决Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name) 中文显示乱码
- 如何让Putty正常显示中文
- 如何解决ASP.NET中中文不能正常显示问题?
- struts2里的struts.xml中 当result的type="stream"
- source-insight中文:utf-8编码的中文字符在source in sight如何正常显示
- 如何解决ASP.NET中中文不能正常显示问题
- 如何在windows的DOS窗口中正常显示中文(UTF-8字符)
- 解决Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name) 中文显示乱码
- 英文操作系统如何正常显示中文软件
- 如何设置让基于matplotlib的绘图库正常的显示no-ascii字符(中文字符)
- matplotlib如何正常显示中文