1.byte[] bytes = replyContent.getBytes("iso-8859-1");
replyContent = new String(bytes,"utf-8");
2.获取参数时直接转换.
String replyContent = java.net.URLDecoder.decode(request.getParameter("replyContent"),"utf-8");
3.json传参时转换
var url ="bbsReplyAction.jsp";
$.post(url,{
replyContent:encodeURI(replyContent),
topicid:topicid,
type:"reply"
}, saveTopicBack);