title: Unicode Character Not Reading - C++
body: <p>I have a simple piece of code that opens a file stream &amp; prints out stuff. 
  As soon as it hits a unicode character, it stops reading.</p>
  
  <p>My system is set to Japanese locale &amp; Visual Studio is set to compile as unicode. Not sure whats going on.</p>
  
  <p><strong>File:</strong></p>
  
  <pre><code>&lt;abc \ 单位孤&gt;hajslklfasjflkesjfleajflj
  </code></pre>
  
  <p><strong>File Hex Dump:</strong></p>
  
  <pre><code>EF BB BF 3C 61 62 63 20 5C 20 E5 8D 95 E4 BD 8D
  E5 AD A4 3E 68 61 6A 73 6C 6B 6C 66 61 73 6A 66
  6C 6B 65 73 6A 66 6C 65 61 6A 66 6C 6A 0D 0A
  </code></pre>
  
  <p><strong>Code Part:</strong></p>
  
  <pre><code>std::wifstream fin(path, std::ios::binary);
  fin.imbue(std::locale(fin.getloc(), new std::codecvt_utf8_utf16&lt;wchar_t, 0x10ffff, std::consume_header&gt;));
  if (!fin.good()) return;
  
  while (fin.good()) {
      std::wcout &lt;&lt; (wchar_t)fin.get() &lt;&lt; "\n";
  }
  
  fin.close();
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/zdcVb.png" alt="Output"></p>