title: convert KOI8-R xml node into unicode in c#
body: <p>I have the following xml:</p>
  
  <pre><code>&lt;root&gt;
     &lt;text&gt;&lt;![CDATA[ОПЕЛХМЮБЮ ОПЕГ БЗПРЪЫ ЯЕ АЮПЮАЮМ, Б ЙНИРН ЯЕ]]&gt;&lt;/text&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>I know this text is generated using encoding KOI8-R (this text is displayed in my text editor only when I select this encoding when I open the xml file as text) and I would like to convert the value of this node into a string usable in c#. I can read the InnerText value of this node, but it's not what I'm expecting. Can someone show me the correct way to convert a string written with this encoding into a Unicode one?</p>
  
  <p><strong>Update</strong></p>
  
  <p>Following Jon Skeet suggestions, the solution would look like this:</p>
  
  <pre><code>Encoding encoding = Encoding.GetEncoding("KOI8-R");
  XmlDocument doc2 = new XmlDocument();
  
  using (TextReader tr = new StreamReader(outputPath, encoding))
  {
      doc2.Load(tr);
  }
  </code></pre>