UTF16Compatibility¶
U16_2_U8¶
static std::string U16_2_U8(const std::u16string str)
Will convert str
(a UTF-16 string) to a regular std::string
.
The naming convention is U16 (like UTF-16) 2 (like "to") U8 (like UTF-8).
It will just cram everything in UTF-8!
Every character that does not exist in UTF-8 will get corrupted!
Only use this function if you KNOW that all characters are within UTF-8!
If you want to escape UTF-16 to UTF-8, you would want to use EscapeUTF16().