title: Need to convert text files to Unicode from UTF8 in vbscript
body: <p>I have a bunch of text files in a folder that I need to change the encoding on to Unicode and instead of manually opening the files and saving them as Unicode I would like to have a script to do this.  </p>
  
  <p>The files are currently in UTF-8 encoding and my extremely limited scripting abilities can't figure this one out.  I found the code below to convert to Unicode from ANSI and when I use this code it does convert it to Unicode but it messes up the characters so the conversion doesn't actually work.  Any thoughts?  Thanks in advance.</p>
  
  <pre><code>Set fso = CreateObject("Scripting.FileSystemObject")
  Set oFolder = fso.GetFolder("C:\test")
  Set oFiles = oFolder.files
  
  For each file in oFiles
  If Right(file.Name, 3) = "txt" Then
  Set ANSIFile = fso.OpenTextFile(file.path, 1, False, False)
  ANSIContent = ANSIFile.ReadAll
  Set UNICODEFile = fso.OpenTextFile(file.path, 2, False, True)
  UNICODEFile.Write ANSIContent
  End If
  Next
  </code></pre>