把XML保存为ANSI编码

   XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.LoadXml(xmlText);

            //plu.xml 编码是ANSI的。否则称上品名是乱码
                XmlElement xeRoot = xmlDoc.DocumentElement;
                XmlDeclaration xdl = xmlDoc.CreateXmlDeclaration("1.0", "gb2312", "yes");
                xmlDoc.InsertBefore(xdl, xeRoot);
                xmlDoc.Save(fileFullName);  
原文地址:https://www.cnblogs.com/runliuv/p/4043345.html