[jQuery] set charset of request header in jQuery.ajax

[jQuery] set charset of request header in jQuery.ajax


Hi
i have an Oracle DB with WE8ISO8859P15 charset and a website with
ISO-8859-15 charset in headers. Until I use jQuery all works fine, but
now i'm using an ajax function to submit a form inside a jQuery ui
dialog, like this:
<script type="text/javascript">
jQuery("#btn_submit").click(function(){
jQuery.ajax({
type: "POST",
datatype: "script",
scriptCharset: "ISO-8859-15",
url: [some url],
data: jQuery("#form").serialize(),
beforeSend: function(xhr) {
xhr.setRequestHeader("Accept-Charset","ISO-8859-15");
xhr.setRequestHeader("Content-type","application/x-www-form-
urlencoded; charset=ISO-8859-15");
},
success: function(data) { jQuery("#dialog").html(data); }
});
});
</script>
When i click in the submit button the data like 'à' is saved into the
DB in UTF-8 with bad characters and then is not displayed correcly.
In the request header shown by firebug i see 'Content-Type:
application/x-www-form-urlencoded; charset=UTF-8', and i don't know
how to modifiy this. I try using the 'scriptCharset' or 'beforeSend'
showed in the script above and no result obtained.
How can i modify the charset in the request header sended by
jQuery.ajax to ISO-8859-15 ?
Thanks a lot!