title: How to pass accented characters from JavaScript to HTML?
body: <p>In JavaScript I create a string which has accented characters such as 'ò' or 'à', e.g. "ò à"</p>
  
  <p>I seem to be unable to create text nodes in html which show the accented characters: if i pass them directly, i get "white question mark in black rhombus"; if i replace the accented characters by the corresponding html entities, i get the entities printed verbatim.<br>
  This function</p>
  
  <pre><code>function showAccents() {
    s1="ò à";
    s2 = s1.replace(/ò/, "&amp;ograve;").replace(/à/, "&amp;agrave");;
    var eD = document.getElementById("accent1");
    var eHT1 = document.createTextNode(s1);
    var eHT2 = document.createTextNode(s2);
    eD.appendChild(eHT1);
    eD.appendChild(eHT2);
  }
  </code></pre>
  
  <p>Produces the following text:</p>
  
  <blockquote>
    <p>� �&ograve; &amp;agrave</p>
  </blockquote>
  
  <p>How do I have to convert the string to get accented characters in HTML?</p>