title: Javascript convert windows-1252 encoding to UTF-8
body: <p>How do I convert the below string:</p>
  
  <pre><code>var string = "Bouchard+P%E8re+et+Fils"
  </code></pre>
  
  <p>using javascript into UTF-8, so that <code>%E8</code> would become <code>%C3%A8</code>?</p>
  
  <p>Reason is this character seems to be tripping up <code>decodeURIComponent</code></p>
  
  <p>You can test it out by dropping the string into <a href="http://meyerweb.com/eric/tools/dencoder/" rel="nofollow">http://meyerweb.com/eric/tools/dencoder/</a> and seeing the console error that says <code>Uncaught URIError: URI malformed</code></p>
  
  <p>I'm looking specifically for something that can decode an entire html document, that claims to be <code>windows-1252</code> encoded which is where I assume this <code>%E8</code> character is coming from, into UTF-8.</p>
  
  <p>Thanks!</p>