fix utf-8 decoder & add u32string functions
This commit is contained in:
@@ -8,3 +8,10 @@ TEST(stringutil, crop_utf8) {
|
||||
str = str.substr(0, util::crop_utf8(str, 7));
|
||||
EXPECT_EQ(str, u8"при");
|
||||
}
|
||||
|
||||
TEST(stringutil, utf8) {
|
||||
std::string str = u8"テキストデモ";
|
||||
auto u32str = util::str2u32str_utf8(str);
|
||||
std::string str2 = util::u32str2str_utf8(u32str);
|
||||
EXPECT_EQ(str, str2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user