title: Sending iso-8859-1 via AJAX POST request?
body: <p>first of all it is a userscript and I can't change the server-side encoding.</p>
  
  <p>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 ?</p>
  
  <p>.</p>
  
  <p>To make sure you understand, here is an exemple:</p>
  
  <p>A classic form on the website send <code>é</code> like this: <code>yournewmessage:%E9</code></p>
  
  <p>Ajax via <code>xhr.send('yournewmessage='+encodeURIComponent('é'))</code> sends this: <code>yournewmessage:%E9%80%80</code></p>
  
  <p>The server needs the former. Thanks to anyone who can help me.</p>