How to convert a char16_t into a stringstream divided with 2 bytes

Advertisements I made a utf8 to utf16 conversion where i get the code units for the utf16 char16_t. { std::string u8 = u8"ʑʒʓʔ"; // UTF-8 to UTF-16/char16_t std::u16string u16_conv = std::wstring_convert< std::codecvt_utf8_utf16<char16_t>, char16_t>{} .from_bytes(u8); std::cout << "UTF-8 to UTF-16 conversion produced " << u16_conv.size() << " code units:\n"; for (char16_t c : u16_conv) std::cout <<… Read More How to convert a char16_t into a stringstream divided with 2 bytes