title: Set charset meta tag with JavaScript
body: <p>There's a bug I'm trying to track down here: <a href="https://github.com/OscarGodson/EpicEditor/issues/184#issuecomment-8805982">https://github.com/OscarGodson/EpicEditor/issues/184#issuecomment-8805982</a></p>
  
  <p>Based on all the information it <em>seems</em> like it's because the browser is defaulting to the user's native charset (in this case, <code>ISO-8859-1</code>) and not <code>UTF-8</code> like on my machine and others in the US. I'm guessing that a fix is to use HTML to force the encoding to <code>UTF-8</code> with:</p>
  
  <pre><code> &lt;meta charset='utf-8'&gt; 
  </code></pre>
  
  <p>or</p>
  
  <pre><code>&lt;meta http-equiv='Content-Type' content='Type=text/html; charset=utf-8'&gt;
  </code></pre>
  
  <p>However, the JS isn't working. In the first example:</p>
  
  <pre><code>charsetMetaTag = self.editorIframeDocument.createElement('meta');
  charsetMetaTag.charset = 'utf-8';
  self.editorIframeDocument.getElementsByTagName('head')[0].appendChild(charsetMetaTag);
  </code></pre>
  
  <p>I just get back the following injected into the DOM:</p>
  
  <pre><code>&lt;meta&gt;
  </code></pre>
  
  <p>And in the 2nd example the <code>http-equiv</code> isn't being set:</p>
  
  <pre><code>charsetMetaTag = self.editorIframeDocument.createElement('meta');
  charsetMetaTag['http-equiv'] = 'Content-Type';
  charsetMetaTag['content'] = 'text/html; charset=utf-8';
  self.editorIframeDocument.getElementsByTagName('head')[0].appendChild(charsetMetaTag);
  </code></pre>
  
  <p>I get back the following HTML:</p>
  
  <pre><code>&lt;meta content="text/html; charset=utf-8"&gt;
  </code></pre>
  
  <p>Yes, I need to do this dynamically as im dynamically creating the iframes.This may not even be the issue, but this is what it's looking like. The only "hack" i can think of is somehow using innerHTML...</p>