title: Character Encoding in .NET
body: <p>I have exported excel 2007 document as CSV (separated by semicolon). I am using CZECH office 2010 and czech windows 7.</p>
  
  <p>When i read file in .net C#, text with special czech symbols is corrupted. It is when i am using </p>
  
  <p>something like string[] lines = file.readalllines(path); (from System.IO.File)</p>
  
  <p>So i guess i need to specially provide right encoding, right? so i tried:</p>
  
  <pre><code>string[] lines = File.ReadAllLines(path,encoding);
  </code></pre>
  
  <p>encoding variable was defined like</p>
  
  <pre><code>Encoding encoding = Encoding.UTF8 for example.
  </code></pre>
  
  <p>None of options worked. And strangest thing, some of them, like Encoding.Unicode even threw </p>
  
  <pre><code>IndexOutOfRandgeException
  </code></pre>
  
  <p>.</p>
  
  <p>How should i fix this encoding problem? Thank you.</p>
  
  <p>BTW, my office manages to open and read that document right way.</p>