Non-Windows versions of Text::utf8ToWide and Text::wideToUtf8 won't obviously handle UTF-16 surrogate pairs at all, thus producing incorrect results. See the following test case for 🌍:
string toUtf8(const wstring& str) {
string tgt;
string::size_type n = str.length();
for (string::size_type i = 0; i < n; ++i) {
Text::wcToUtf8(str[i], tgt);
}
return tgt;
}
Non-Windows versions of Text::utf8ToWide and Text::wideToUtf8 won't obviously handle UTF-16 surrogate pairs at all, thus producing incorrect results. See the following test case for 🌍:
string toUtf8(const wstring& str) { :wcToUtf8( str[i], tgt);
string tgt;
string::size_type n = str.length();
for (string::size_type i = 0; i < n; ++i) {
Text:
}
return tgt;
}
wstring emoji = L"\U0001F30D"; EQ(Text: :wideToUtf8( emoji), toUtf8(emoji)); // error
ASSERT_