title: international characters in Javascript
body: <p>I am working on a web application, where I transfer data from the server to the browser in XML.</p>
  
  <p>Since I'm danish, I quickly run into problems with the characters <code>æøå</code>.</p>
  
  <p>I know that in html, I use the <code>"&amp;amp;aelig;&amp;amp;oslash;&amp;amp;aring;"</code> for <code>æøå</code>.</p>
  
  <p>however, as soon as the chars pass through JavaScript, I get black boxes with <code>"?"</code> in them when using <code>æøå</code>, and <code>"&amp;aelig;&amp;oslash;&amp;aring;"</code> is printed as is.</p>
  
  <p>I've made sure to set it to utf-8, but that isn't helping much.</p>
  
  <p>Ideally, I want it to work with any special characters (naturally).</p>
  
  <p>The example that isn't working is included below:</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
      &lt;title&gt;Untitled Document&lt;/title&gt;
          &lt;script type="text/javascript" charset="utf-8"&gt;
              alert("&amp;aelig;&amp;oslash;&amp;aring;");
              alert("æøå");
  
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <hr>
  
  <p>Ok, thanks to Grapefrukts answer, I got it working.</p>
  
  <p>I actually needed it for data coming from an MySQL server. Since the saving of the files in UTF-8 encoding only solves the problem for static content, I figure I'd include the solution for strings from a MySQL server, pulled out using PHP:</p>
  
  <p><code>utf8_encode($MyStringHere)</code></p>