1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
/// <summary>
/// Changes the XML encoding.
/// </summary>
/// <param name="xmlDoc">The XmlDocument.</param>
/// <param name="newEncoding">The new encoding.</param>
/// <returns></returns>
private XmlDocument ChangeXmlEncoding(XmlDocument xmlDoc, string newEncoding)
{
if (xmlDoc.FirstChild.NodeType == XmlNodeType.XmlDeclaration)
{
XmlDeclaration xmlDeclaration = (XmlDeclaration)xmlDoc.FirstChild;
xmlDeclaration.Encoding = newEncoding;
}
return xmlDoc;
}
|