首页 > 技术文章 > 前台中文搜索到后台乱码

wujixing 2016-09-09 08:56 原文

前台, 用encodeURI

 $.getJSON("/portal/edu/findEduList?keyword="+encodeURI(keyword,"utf-8")+"&rn="+Math.random(),function(data){	

 

后台用decode解析

try {
			URLDecoder.decode(keyword,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
		}

 

推荐阅读