我想通过JavaScript发送XMLHttpRequest,一切正常。但是当我尝试发送波斯语字符串而不是英语时,我得到了这个错误:
TypeError: Cannot convert string to ByteString because the character at index 0 has value 1587 which is greater than 255.
请注意,此错误仅出现在Firefox和Chrome上,但一切正常。 这是我的代码片段:
var xmlhttp;
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
}
else {// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.setRequestHeader("serviceName", "سیبس"); // The line that cause of error