ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Remove BOM from UTF-8 file (https://www.excelbanter.com/excel-discussion-misc-queries/86149-remove-bom-utf-8-file.html)

mah_kum_70

Remove BOM from UTF-8 file
 

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


--
mah_kum_70
------------------------------------------------------------------------
mah_kum_70's Profile: http://www.excelforum.com/member.php...fo&userid=2572
View this thread: http://www.excelforum.com/showthread...hreadid=537718



All times are GMT +1. The time now is 02:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com