C++20 added char8_t
and std::u8string
for UTF-8. However, there is no UTF-8 version of std::cout
and OS APIs mostly expect char
and execution character set. So we still need a way to convert between UTF-8 and execution character set.
I was rereading a char8_t paper and it looks like the only way to convert between UTF-8 and ECS is to use std::c8rtomb
and std::mbrtoc8
functions. However, their API is extremely confusing. Can someone provide an example code?