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?