I have IE 7 + 8 and page which has
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
I’m sending string using AJAX which has Arabic character.
my problem is that the string which arrives to the server has ???? values on IE 7 and Gibrish on IE8. English chars are just fine.
function getXmlHttpObject()
{
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
return xmlHttp;
}
and then the AJAX itself:
function updateName()
{
//updateLocal();
xmlHttp = getXmlHttpObject();
var username = document.getElementById('username').value;
xmlHttp.onreadystatechange=function(){onResponseUpdateOrderName();};
var params = "username=" +username;
xmlHttp.open("POST",myRootLink+"/myServlet/?"+params,true);
var boundaryString = 'bound';
var boundary = '--' + boundaryString;
var requestBody = [
boundary,
params,
boundary,
].join('\r\n');
xmlHttp.setRequestHeader("Content-length", requestBody.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.setRequestHeader('Content-type', 'text/xml;charset=utf-8');
xmlHttp.send(requestBody);
}
How can I send it solve this issue?
Replace
with