开发者

non english characters are displaying ???? in IE

I'm working on an application using PHP, JavaScript and Ajax. My application works fine in Chrome, Firefox and Safari but not in Internet Explorer.

Details:

I am translating my content into Arabic and Russian and disp开发者_Go百科laying it in the text fields. When I try to post the values of the text fields with JavaScript and Ajax using the GET method then it shows ????? instead of the values for Arabic and Russian. All of my pages contain:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

I have saved the .js file with UTF-8 encoding. It contains this code:

xmlhttp.open("GET","save_banner2.php?b1="+banner1+"&b2="+banner2, true);

Any ideas what might be wrong?


Maybe try using encodeURIComponent:

xmlhttp.open("GET","save_banner2.php?b1="+encodeURIComponent(banner1)+"&b2="+encodeURIComponent(banner2), true);


You have to examine

Content-Type: ...; charset=utf-8

header in your server response. It has to contain the right encoding, which always takes precedence over <meta> tag.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜