To remove the byte order mark while using LINQ-to-XML, we must specify the encoding to be
used with an XML writer. The following code will write the XDocument file to disk
[Sample]
XmlWriterSettings settings = new XmlWriterSettings();
settings.Encoding = new System.Text.UTF8Encoding(false);
using (XmlWriter writer = XmlWriter.Create("FileName.xml", settings))
{
file.Save(writer);
}
'IT_Programming > LINQ' 카테고리의 다른 글
LINQ 에서 T-SQL 의 LIKE 함수처럼 구현하기 (0) | 2009.12.29 |
---|---|
[C#3.0_Linq] Linq를 이용하여 XML 데이터 읽어 오기 (0) | 2009.06.26 |