存进数据库前进行编码 comment.setContent(URLEncoder.encode(comment.getContent(), "utf-8")); 取出前解码 comment.setContent(URLDecoder.decode(comment.getContent(), "utf-8"));