mardi 25 octobre 2016

Read Unicode UTF-32 file into wstring

For UTF-16, we can read and convert it to wcahr 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 it for UTF-32?

Aucun commentaire:

Enregistrer un commentaire