重点注意第二种方法,它 charset 这个东东中间是不能有空格的,分享个小坑~~
//第一种方法 response.setCharacterEncoding("utf-8"); response.setHeader("Content-Type", "text/html;char set=utf-8"); //第二种方法 response.setContentType("text/html; charset=utf-8");
重点注意第二种方法,它 charset 这个东东中间是不能有空格的,分享个小坑~~
//第一种方法 response.setCharacterEncoding("utf-8"); response.setHeader("Content-Type", "text/html;char set=utf-8"); //第二种方法 response.setContentType("text/html; charset=utf-8");