title: How to change character encoding of XmlReader
body: <p>I have a simple XmlReader:</p>
  
  <pre><code>XmlReader r = XmlReader.Create(fileName);
  
  while (r.Read())
  {
      Console.WriteLine(r.Value);
  }
  </code></pre>
  
  <p>The problem is, the Xml file has <code>ISO-8859-9</code> characters in it, which makes XmlReader throw "<code>Invalid character in the given encoding.</code>" exception. I can solve this problem with adding <code>&lt;?xml version="1.0" encoding="ISO-8859-9" ?&gt;</code> line in the beginning but I'd like to solve this in another way in case I can't modify the source file. How can I change the encoding of XmlReader?</p>