B/S应用中,下载一个附件保存时,中文文件名会乱码,在实际开发中经常遇到,现贴出C#和JAVA的解决方法:
C#:
Response.AppendHeader("Content-Disposition", "attachment;filename=" + Tools.toUtf8String(result));
其中用到的转换方法:
JAVA:
resp.addHeader("Content-Disposition","attachment;filename=" + Tools.toUtf8String(m_entityIndex.m_sName) + ".xls");
posted on 2009-01-22 15:15 jumliang 阅读(551) 评论(0) 编辑 收藏
Powered by: BlogJava Copyright © jumliang