In C #, I need to create XML files for use with Ivy and NAnt, but I find it difficult to get the correct encoding in the output file.
If I use XElement.Save ("C: \ foo.xml"), I get a correctly looking file, but Ivy and / or NAnt are upset, since the file is actually saved using UTF-8, but I really need to save it as ANSI to be able to use it.
I currently have a binding that needs to use .ToString () to get the text, and then use StreamWriter to write to the file.
Ideally, I would like to set the format during .Save (), but cannot find any information about this.
Thank.
source
share