first of all it is a userscript and I can't change the server-side encoding.
My problem is that when using encodeURIComponent() for encoding POST params (later sent via xhr.setRequestHeader), the characters are encoded in utf-8, but the server needs to receive iso-8859-1 data. Is there an alternative to encodeURIComponent() that would encode in iso-8859-1 ?
.
To make sure you understand, here is an exemple:
A classic form on the website send é
like this: yournewmessage:%E9
Ajax via xhr.send('yournewmessage='+encodeURIComponent('é'))
sends this: yournewmessage:%E9%80%80
The server needs the former. Thanks to anyone who can help me.