使用IO流来确保编码正确
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
ServletOutputStream sos = response.getOutputStream();
sos.write("你好123".getBytes("UTF-8"));//getBytes默认编码为本地编码(即:gbk)
}