mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix utf-8 decoder & add u32string functions
This commit is contained in:
parent
bd87a586d8
commit
4343e81e00
3 changed files with 60 additions and 22 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue