StreamWriter and UTF-8 Byte Order Marks

后端 未结 8 906
走了就别回头了
走了就别回头了 2020-11-27 19:02

I\'m having an issue with StreamWriter and Byte Order Marks. The documentation seems to state that the Encoding.UTF8 encoding has byte order marks enabled but when files are

8条回答
  •  情书的邮戳
    2020-11-27 19:50

    Seems that if the file already existed and didn't contain BOM, then it won't contain BOM when overwritten, in other words StreamWriter preserves BOM (or it's absence) when overwriting a file.

提交回复
热议问题