title: Convert UTF-8 to ANSI using VBA
body: <p>I have a VBA Excel code which takes Japanese data from excel sheet compares it with Japanese data in text file and replaces Japanese words with English words. But I am supposed to be able to do this on UTF-8 text file. This code replaces all the Japanese words with weird characters. How do I save without any issue ?</p>
  
  <pre><code>Open sFileName For Input As iFileNum
  
  For n = 1 To lngLastCell
  Label5.Caption = n &amp; "/" &amp; lngLastCell
  searchtext = MySearch(n)
  valuetext = MyText(n)
  
  eplcCount = 0
  spltCount = 0
  
  searchpart = Array(searchtext)
  valuepart = Array(valuetext)
  
  Do Until EOF(iFileNum)
  Line Input #iFileNum, sBuf
  sTemp = sTemp &amp; sBuf &amp; vbCrLf
  
  Loop
  
  
  Close iFileNum
  
  sTemp = Replace(sTemp, searchtext, valuetext)
  
  'iFileNum = FreeFile
  Open sFileName For Output As iFileNum
  Print #iFileNum, sTemp
  
  Next n 
  </code></pre>
  
  <p>Code works well with ANSI characters.</p>