首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >写文本文件没有字节顺序标记(BOM)?

写文本文件没有字节顺序标记(BOM)?

提问于 2018-04-08 00:56:37
回答 2关注 0查看 130

可以用UTF 8编码写文件,但是,如何从它中删除ByteOrderMark?

试过这样的代码;

代码语言:txt
复制
    Dim utf8 As New UTF8Encoding()
    Dim utf8EmitBOM As New UTF8Encoding(True)
    Dim strW As New StreamWriter("c:\temp\bom\1.html", True, utf8EmitBOM)
    strW.Write(utf8EmitBOM.GetPreamble())
    strW.WriteLine("hi there")
    strW.Close()

        Dim strw2 As New StreamWriter("c:\temp\bom\2.html", True, utf8)
        strw2.Write(utf8.GetPreamble())
        strw2.WriteLine("hi there")
        strw2.Close()

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档