JQuery AJAX is not sending UTF-8 to my server, only in IE.

Posted by alex on Stack Overflow See other posts from Stack Overflow or by alex
Published on 2010-03-18T21:00:06Z Indexed on 2010/03/30 23:53 UTC
Read the original article Hit count: 469

Filed under:
|
|
|
|

I am sending UTF-8, japanese text, to my server. It works in Firefox. My access.log and headers are:

/ajax/?q=%E6%BC%A2%E5%AD%97
Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
Content-Type    application/x-www-form-urlencoded; charset=UTF-8

Howeer, in IE8, my access.log says:

/ajax/?q=??

For some reason, IE8 is turning my AJAX call into question marks. Why!? I added the scriptCharset and ContentType according to some tutorials, but still no luck.

And this is my code:

$.ajax({
>---method:"get",
>---url:"/ajax/",
    scriptCharset: "utf-8" ,
    contentType: "application/x-www-form-urlencoded; charset=UTF-8",
>---data:"q="+query ...
    ...

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript