Writing UTF-8/16 to file, what's the alternative to codecvt_utf16 after it has been deprecated?

Viewed 310

As we know when writing UTF-8/16 to a file you should use std::codecvt_utf16 or std::codecvt_utf8_utf16 as follow:

std::wofstream WFile("file.txt");
if (!WFile.is_open()) return false;
WFile.imbue(std::locale(WFile.getloc(), new std::codecvt_utf16<az::cChar, 0x10ffff, std::little_endian>()));
WFile << (wchar_t)0xfeff;
WFile << L"日本語|भारतीय|русский язык|";
WFile.close();

Currently, std::codecvt_utf16 and std::codecvt_utf8_utf16 have been deprecated, so, what the alternative to make the output stream to write UTF-8/16?

0 Answers
Related