It seems that when I use GET instead of POST, the content type header
is correctly changed to what I specify.

But even so, this is not a stable fix as I want to POST.

Any ideas?


On Jan 22, 7:09 pm, Nicolas R <ruda...@googlemail.com> wrote:
> I need some help here guys.
> I'm trying to modify the content-type and accept-charsetrequest
> headers of an ajax call and it seems that beforeSend does not really
> change the XHR object.
>
> My code is something like this:
>                 beforeSend : function(xhr) {
>                         xhr.setRequestHeader('Accept-Charset','windows-1253');
>                         
> xhr.setRequestHeader('Content-type','application/x-www-form-
> urlencoded;charset=windows-1253')
>                 }
>
> I need the charset to be windows-1253 and not UTF-8, as the database
> and everything in between (server side scripts) are encoded with
> windows-1253.
>
> My html page has the correct charset specified:
>         <meta http-equiv="Content-Type" content="text/html;
> charset=windows-1253" />
>         <meta http-equiv="Content-Script-Type" content="text/javascript;
> charset=windows-1253" />
>
> If I submit the form without ajax, the charset is ok and my data is
> saved correctly. Otherwise non-latin characters are replaced with
> weird characters. From what I understand, changing the charset &
> encoding to UTF-8 is currently not an option.
>
> Any suggestions? Is this a jquery bug or I'm I doing something wrong?

Reply via email to