Jquery+jsp 页面乱码

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);

你可能感兴趣的:(java,jquery,.net,json,jsp)