title: Writing UTF8 text to file
body: <p>I am using the following function to save text to a file (on IE-8 w/ActiveX).</p>
  
  <pre><code>function saveFile(strFullPath, strContent)
  {
      var fso = new ActiveXObject( "Scripting.FileSystemObject" );
  
      var flOutput = fso.CreateTextFile( strFullPath, true ); //true for overwrite
      flOutput.Write( strContent );
      flOutput.Close();
  }
  </code></pre>
  
  <p>The code works fine if the text is fully Latin-9 but when the text contains even a single UTF-8 encoded character, the write fails.</p>
  
  <p>The ActiveX FileSystemObject does not support UTF-8, it seems. I tried UTF-16 encoding the text first but the result was garbled. What is a workaround? </p>