I have both sending and receiving jsp pages are encoded in UTF-8 jquery.post call works except IE. Page inputs are expected to be in Turkish language. Turkish special characters çşığü messed up.
$.post('/answer.jsp', {cmd:'doSomething',nickname:nickNameUser},
function(data){
if(data!=null && data.success){
window.location.href="/main.htm";
}
else{
$('#formError').text(data.error);
}
},
'json');
What I have tried but failed
1-) I convert receiving jsp file to ISO-8859-9 and convert post to ajax provided charset
$.ajax({type:'POST',
url:'/answer.jsp',
data:{cmd:'doSomething', nickname:NickNameUser},
dataType:'json',
contentType: 'application/json; charset=ISO-8859-9',
cache: false,
success:function(data){
if(data!=null && data.success){
window.location.href="/main.htm";
}
else{
$('#formError').text(data.error);
}
}
});
2-) I tried on Java side following
nickname = new String(nickname.getBytes("utf-8"), "iso-8859-9");
None of them worked. Do you know any workaround?. By the way I hate IE.