I have a simple piece of code that opens a file stream & prints out stuff. 
As soon as it hits a unicode character, it stops reading.

My system is set to Japanese locale & Visual Studio is set to compile as unicode. Not sure whats going on.

**File:**

```
<abc \ 单位孤>hajslklfasjflkesjfleajflj

```

**File Hex Dump:**

```
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 Part:**

```
std::wifstream fin(path, std::ios::binary);
fin.imbue(std::locale(fin.getloc(), new std::codecvt_utf8_utf16<wchar_t, 0x10ffff, std::consume_header>));
if (!fin.good()) return;

while (fin.good()) {
    std::wcout << (wchar_t)fin.get() << "\n";
}

fin.close();

```

**Output:**

![Output](https://i.stack.imgur.com/zdcVb.png)