0

I create xml and write it like this.

  public async void Creation()
    {

            XmlDocument order = new XmlDocument();

        XmlElement el = (XmlElement)order.AppendChild(order.CreateElement("root"));
            el.SetAttribute("date", "1");
            el.SetAttribute("salescode", "");
            el.SetAttribute("sum", "");
            el.SetAttribute("clientname", "1");
            el.SetAttribute("clientcontact", "0");
            el.SetAttribute("adress", "{StreetName} , ..");
            el.SetAttribute("primitka", "0");
        StorageFolder folder = ApplicationData.Current.LocalFolder;
        StorageFile file = await folder.CreateFileAsync("test.xml", CreationCollisionOption.ReplaceExisting);
        await order.SaveToFileAsync(file);

    }

I need to set Windows-1251 encoding

How I can do this?

  • 1
    Look here: http://stackoverflow.com/questions/12208735/how-to-include-encoding-when-creating-xml-files – Icemanind Oct 18 '16 at 16:23
  • Possible helpful information over at [How to save string to text file with ASCII encoding in Windows store apps/WinRT?](http://stackoverflow.com/questions/21254608/how-to-save-string-to-text-file-with-ascii-encoding-in-windows-store-apps-winrt) – Cᴏʀʏ Oct 18 '16 at 16:23

0 Answers0