var name = "Świat";
jQuery.ajax({
async: false,
contentType: "application/x-www-form-urlencoded;charset=UTF-8",
type: 'POST',
url: "test.do?name="+encodeURIComponent(name),
noCache:true,
data:{
},
beforeSend: function(xhr) {
xhr.setRequestHeader("Accept-Charset","UTF-8");
xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");
...
在java中,我将具有如下价值:
String pName = request.getParameter("name");
pName = "Å?wiat";
现在我想使用此名称从数据库中搜索记录,但在 db 中具有“Świat”的值
我怎样才能找到这个或解码这个?