jsp部分:
contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>html部分:
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">过滤器:
request.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");
chain.doFilter(request, response);感觉该有的都有了啊。服务器:centOS 服务器编码:en_us.utf-8在windows上测试没有问题,但布署到远程centOS上后,发现网页里静态的中文显示正常,凡是out.print输出内容,中文全部乱码,请问是怎么回事呢?
contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>html部分:
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">过滤器:
request.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");
chain.doFilter(request, response);感觉该有的都有了啊。服务器:centOS 服务器编码:en_us.utf-8在windows上测试没有问题,但布署到远程centOS上后,发现网页里静态的中文显示正常,凡是out.print输出内容,中文全部乱码,请问是怎么回事呢?
如果还不行,你加入日志,看看到底哪个环节出问题。
response.setContentType("text/html;charset=utf-8");
out对象的获取要在上两行代码后面写,试下行不