title: How to input emojis from files using C++?
body: <p>I have the following code,</p>
  <pre class="lang-cpp prettyprint-override"><code>main()
  {
      freopen(&quot;in.txt&quot;,&quot;r&quot;,stdin);
      wstring s;
      while(wcin&gt;&gt;s)
      {
              wcout&lt;&lt;s&lt;&lt;&quot; &quot;;
      }
  }
  </code></pre>
  <p>and the <code>in.txt</code> file contains a single emoji <code></code>. But when I run the following program I get the following output,</p>
  <pre><code>≡ƒÿé
  </code></pre>
  <p>How can I fix this?</p>