C# utf-8编码写入文件 默认的 utf-8 实质上是 utf-8 with BOM
所以说我们在指定 utf-8 编码的时候 要 去掉 BOM
Encoding encoding = new System.Text.UTF8Encoding(false);

博客介绍了在C#中使用utf-8编码写入文件的情况,默认的utf-8是utf-8 with BOM,若要去掉BOM,可使用代码Encoding encoding = new System.Text.UTF8Encoding(false)来指定无BOM的utf-8编码。
C# utf-8编码写入文件 默认的 utf-8 实质上是 utf-8 with BOM
所以说我们在指定 utf-8 编码的时候 要 去掉 BOM
Encoding encoding = new System.Text.UTF8Encoding(false);

1293

被折叠的 条评论
为什么被折叠?