title: Escaping non-ASCII characters (or how to remove the BOM?)
body: <p>I need to create an ANSI text file from an Access recordset that outputs to JSON and YAML. I can write the file, but the output is coming out with the original characters, and I need to escape them. For example, an umlaut-O (ö) should be "\u00f6". </p>
  
  <p>I thought encoding the file as UTF-8 would work, but it doesn't. However, having looked at the file coding again, if you write "UTF-8 without BOM" then everything works.</p>
  
  <p>Does anyone know how to either</p>
  
  <p>a) Write text out as UTF-8 without BOM, or
  b) Write in ANSI but escaping the non-ASCII characters?</p>
  
  <pre><code>Public Sub testoutput()
  
  Set db = CurrentDb()
  
  str_filename = "anothertest.json"
  MyFile = CurrentProject.Path &amp; "\" &amp; str_filename
  str_temp = "Hello world here is an ö"
  
  fnum = FreeFile
  
  Open MyFile For Output As fnum
  Print #fnum, str_temp
  Close #fnum
  
  End Sub
  </code></pre>