For UTF-16, we can read and convert it to wchar
at the same time. For example,
std::wifstream* file = new std::wifstream(name, ifstream::binary);
locale lo = locale(file->getloc(), new std::codecvt_utf16<wchar_t, 0x10ffff, std::little_endian>);
file->imbue(lo);
How could I do the same for UTF-32 input?