Remove BOM from UTF-8 file

  • Thread starter Thread starter mah_kum_70
  • Start date Start date
M

mah_kum_70

Hello,

I am creating a UTF-8 file using excel vba. It is putting the 3 byte
Byte Order Mark at the begining of the file automatically. Is there a
way to remove it?

I am using the following code to generate the file.


Sub MACRO5()
Dim DataSet As New ADODB.Stream
With DataSet
..Open
..Charset = "utf-8"
..WriteText "Line one "
..WriteText vbCrLf
..WriteText "Line two"


..SaveToFile "C:\temp\utftest.txt"
End With
DataSet.Close

Set DataSet = Nothing
end sub
 
Back
Top