title: Reading ISO-8859 type file containing special characters such as é in C++
body: <p><br />
  I'm trying to read a file which is encoded in ISO-8859(ansi), and it contains some west European characters such as "é".<br />
  When I try to read the file and output the result, all the special characters appear as �, whereas normal alphabets appear correctly.<br /><br />
  If I convert the file to utf-8 format and then do the same job, everything works perfectly.<br />
  Does anyone have any idea to solve this problem? I tried to use <em>wifstream</em> and <em>wstring</em> instead of <em>ifstream</em> and <em>string</em> but didn't help much.</p>
  
  <p>Here's my sample code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  int main()
  {
      ifstream myFS;
      myFS.open("test.txt", ios::in);
      string myString; 
      if(myFS.is_open()){
          while(myFS &gt;&gt; myString)
              cout &lt;&lt; myString &lt;&lt; endl;
      }
      myFS.close();
      return 0;
  }
  </code></pre>
  
  <p>test.txt (ISO-8859-15 format) contains:</p>
  
  <pre><code>abcd éfg
  </code></pre>
  
  <p>result:</p>
  
  <pre><code>abcd 
  �fg
  </code></pre>
  
  <p>Any advice will be appreciated.
  Thank you in advance!</p>
  
  <hr>
  
  <p>+)<br />
  forgot to mention my system environment. <br />
  I'm using ubuntu 10.10(Maverick) console with g++ ver 4.4.5 <br />
  Thanks!</p>