title: javascript encoding issue with accented characters
body: <p>I have a page with UTF-8 header:</p>
  
  <pre><code>&lt;meta charset="utf-8" /&gt;
  </code></pre>
  
  <p>And in the page I use the umbraco dictionary to fetch content in various languages.
  When I print this in German on the page it appears fine:</p>
  
  <pre><code>&lt;h1&gt;@library.GetDictionaryItem("A")&lt;/h1&gt;
  </code></pre>
  
  <p>resolves to:</p>
  
  <p><code>&lt;h1&gt;Ä&lt;/h1&gt;</code> in German</p>
  
  <p>However if I enter it via a script:</p>
  
  <pre><code>&lt;script type="text/javascript" charset="utf-8"&gt;
    var a = "@library.GetDictionaryItem("A")";
    alert(a);
  &lt;/script&gt;
  </code></pre>
  
  <p>The alert prints:</p>
  
  <pre><code>&amp;#228;
  </code></pre>
  
  <p>If I do</p>
  
  <pre><code>&lt;script type="text/javascript" charset="utf-8"&gt;
    var a = "Ä";
    alert(a);
  &lt;/script&gt;
  </code></pre>
  
  <p>The alert prints:</p>
  
  <pre><code>Ä
  </code></pre>
  
  <p>So what could explain this behaviour and how can I fix the alert?
  As far as I can see everything is UTF-8 and the dictionary and the page encoding is fine. The problem happens within Javascript.</p>
  
  <p>From what I can see from the table here, Javascript resolves the character into it's Numeric value. I used "escape, encodeUrl, decodeUrl" etc with no luck.</p>
  
  <pre><code>chr  HexCode  Numeric   HTML entity     escape(chr)  encodeURI(chr) 
  
  ä    \xE4     &amp;#228;    &amp;auml;          %E4          %C3%A4 
  </code></pre>