include locale include codecvt typedef std codecvt_utf16 wchar_t 0x10f

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#include <locale>
#include <codecvt>
typedef std::codecvt_utf16<wchar_t, 0x10ffff, std::little_endian> utf16le_converter_type;
std::locale utf16le_locale(std::locale::empty(), new utf16le_converter_type);
std::wifstream ndo(L"npcdata.txt", std::ios::binary);
std::wofstream ndr(L"npcdata_rated.txt", std::ios::binary);
ndo.imbue(utf16le_locale);
ndr.imbue(utf16le_locale);