Reputation: 86075
I can specify encoding in the streamReader. I am wodnering if I cna specify encoding in the xmlReader
Upvotes: 0
Views: 434
Reputation: 65867
You can use StreamReader with XmlReader.Create, which supports encoding schemes
something like this
var xml = XmlReader.Create(new StreamReader(file, Encoding.ASCII))
Upvotes: 2
Reputation: 11903
I think you can't. Normally, the XML file should contain an encoding at the beginning. You can override this in a StreamReader, but I guess the XmlReader just doesn't deal with that kind of thing.
Upvotes: 0