在本机的eclipse上导出不会乱码,都是UTF-8格式,但是在linux服务器上的程序导出会乱码,linux的字符集编码是zh_ch.utf-8,
有没有帮我解决一下
if (oper.equals("del")) {
} else if (oper.equals("excel")) {
response.setContentType("application/msexcel;charset=UTF-8");
try {
response.addHeader("Content-Disposition", "attachment;filename=exportfile.xls");
OutputStream out = response.getOutputStream();
out.write(URLDecoder.decode(request.getParameter("csvBuffer"),"UTF-8").getBytes());
out.flush();
out.close();
} catch (Exception e) {
e.printStackTrace();
}
导出的代码这么写的,找不到原因了,一直觉得是服务器和tomcat编码不知道的问题,服务器上的tomcat我已经在配置文件里边都弄成了UTF-8