ajax提交汉字到后台保存时乱码问题!

前端(转换):

  var param = XXX;            //需要转换的数据
  param = decodeURIComponent(param,true);
  param = encodeURI(param, "UTF-8");
AJAX提交时:"...&参数= " +  encodeURI(param, "UTF-8");

 

后台(解析):

  String remark = URLDecoder.decode(getRequest().getParameter(参数), "utf-8");

posted on 2017-08-24 09:44  java浪里小白龙  阅读(458)  评论(0编辑  收藏  举报

导航