protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setHeader("Content-Type", "text/html;chaset=utf-8");
response.setContentType("text/html;chaset=utf-8");
String hanzi = "这是一串汉字";
OutputStream out = response.getOutputStream();
out.write(hanzi.getBytes("utf-8"));
}
代码如上,在chrome中运行是正常的,但是在360中运行就会出错误,为什么?
乱码的出现和浏览器是不是也有关系?