C#使用StreamWriter生成UTF-8无BOM编码格式
使用UTF-8格式产生的文件,用二进制查看会多出“\xef\xbb\xbf”几个字节
使用UTF-8无BOM格式:
UTF8Encodingutf8 = new UTF8Encoding(false);StreamWriter sw = new StreamWriter (strPath,false,utf8);sw.WriteLine(strHtml);
发布时间: 2013-11-08 17:52:32 作者: rapoo
C#使用StreamWriter生成UTF-8无BOM编码格式
使用UTF-8格式产生的文件,用二进制查看会多出“\xef\xbb\xbf”几个字节
使用UTF-8无BOM格式:
UTF8Encodingutf8 = new UTF8Encoding(false);StreamWriter sw = new StreamWriter (strPath,false,utf8);sw.WriteLine(strHtml);