title: C# Help reading foreign characters using StreamReader
body: <p>I'm using the code below to read a text file that contains foreign characters, the file is encoded ANSI and looks fine in notepad. The code below doesn't work, when the file values are read and shown in the datagrid the characters appear as squares, could there be another problem elsewhere?</p>
  
  <pre><code>StreamReader reader = new StreamReader(inputFilePath, System.Text.Encoding.ANSI);
  using (reader = File.OpenText(inputFilePath))
  </code></pre>
  
  <p>Thanks</p>
  
  <p><strong>Update 1</strong>: I have tried all encodings found under <code>System.Text.Encoding</code>. and all fail to show the file correctly.</p>
  
  <p><strong>Update 2</strong>: I've changed the file encoding (resaved the file) to unicode and used <code>System.Text.Encoding.Unicode</code> and it worked just fine. So why did notepad read it correctly? And why didn't <code>System.Text.Encoding.Unicode</code> read the ANSI file?</p>