jQuery set ISO charset to ajax request -
I am using jQuery to send AJAX requests to the server, but I have some problems with the pigment. Function documentation has been written that the data always contain W3C in UTF-8. XMLHttpReight is sent according to the standard, so I do not think jQuery allows you to change the request charset (except if you load a script but this is not my case).
Do you know a way to set ISO-8859-1 charsets for AJAX requests in jQuery?
I think this is not possible. You can try to override the
AJAX
call. I tried it with this: $ Ajax ('url:' /exec/seoportservice.pl ', type:' post ', data: {foo: "bar"}, data type:' text ', before: function (xir) {xhr.setRequestHeader (' Content-type ',' test ');} success: work (data) {console.log (' success: '+ data);},});
This will actually override the content-type
header, but still charset = UTF-8 will be set to
.
So I think you have to handle the encoding server side.
Comments
Post a Comment