Javascript convert string from utf-8 to iso-8859-1

I know this sounds bad, but it is necessary.

I have an HTML form on a site with utf-8 encoding, which is sent to a server that works with iso-8859-1 encoding. The problem is that the server does not correctly understand the characters that we use in Spain, for example, à, á, è, é, ì, í, ò, ó, ù, ú, ñ, çand so on. Therefore, if I am looking for something like artículo, it does not respond with help artículo.

I submit the form using ajaxform ( http://malsup.com/jquery/form/ ) and the loks code looks like this:

$(".form-wrap, #pagina").on("submit", "form", function(event){
    event.preventDefault();
    $(this).ajaxSubmit({

        success: function(data){
            $("#temp").html(data);
            //Handle data in #temp div
            $("#temp").html('');
        }
    });
    return false;
});

My problem: I do not have access to the search server, and I can not change the entire site to iso-8859-1 encodig, as this will break other things.

I tried alredy without executing these scripts:

?

: escape , % , , art%EDculo.

encodeURIComponent, art%C3%ADculo. artículo , .

+4
2

, , , , php script, utf-8. .

-2

HTML- utf-8, , iso-8859-1.

accept-charset:

<form accept-charset="iso-8859-1">
....
</form>
+1

All Articles