1.前台中文参数用encodeURIComponent()进行编码,如:
var textName= encodeURIComponent(name);
2.对整个URL用encodeURI()进行编码,如:
var p = encodeURI("xxx?name="+textName);
3.后台解码
name = new String(name.getBytes("ISO-8859-1"),"UTF-8");