// 处理ie和fireFox下载的文件名的乱码问题
public static String fileNameForEveryBrower(HttpServletRequest req,
String fileName) {
String ret = fileName;
try {
String agent = req.getHeader("USER-AGENT");
if (null !=agent && !agent.equals("") && agent.indexOf("MSIE") >= 0) {
ret = URLEncoder.encode(ret, "UTF-8");
} else if (null !=agent && !agent.equals("")
&& agent.indexOf("Mozilla") >= 0) {
//ret = MimeUtility.encodeText(ret, "UTF8", "B");
ret = URLEncoder.encode(ret, "UTF-8");
} else {
ret = URLEncoder.encode(ret, "UTF-8");
}
} catch (Exception ex) {
// 不处理
}
return ret;
}