微信公众号消息自动回复中文乱码问题

设置servlet请求和响应为utf-8,如下:

HttpServletRequest request = this.getRequest();
HttpServletResponse response = this.getResponse();
try {
    request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
} catch (UnsupportedEncodingException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
}

你可能感兴趣的:(微信公众号消息自动回复中文乱码问题)