标签:pre protect hello override tty utf-8 type cte 编码
@WebServlet("/userServlet") public class UserServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.getWriter().print("Hello World,世界您好!"); //设置浏览器编码格式,我都告诉浏览器用什么编码解析了,为什么还会出现乱码呢? //浏览器解析的编码却是iso,我也不清楚为什么会是这样。 response.setContentType("text/html;character=utf-8"); response.getWriter().flush(); response.getWriter().close(); } }
097-为什么我们在SpirngBoot中设置了响应头的编码,浏览器解析出来依然回事乱码呢?
标签:pre protect hello override tty utf-8 type cte 编码
原文地址:https://www.cnblogs.com/pogusanqian/p/12957956.html