java乱码解决方案

1.JSP页面更改字符集

2.post:

   request.SetCharacterEncoding("utf-8");

3.get:

   1.修改tomcat配置

   2.加过滤器

4.数据库

   mysql:create table xx()engine=Innodb default charset=utf-8;

5.jdbc url

 mysql: jdbc://localhost:3306/xx?use Unicode=true & characterEncoding=utf-8

6.项目的编码

7.响应数据字符集的设置

response.setCharacterEncoding("utf-8");

猜你喜欢

转载自blog.csdn.net/qq_38146131/article/details/82110464