Skip to content

Commit

Permalink
test setting u8 string literals
Browse files Browse the repository at this point in the history
In C++20 it would use char8_t.
  • Loading branch information
robUx4 committed Dec 26, 2023
1 parent 371f37f commit 11c9c7a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/test_utfstring.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using namespace libebml;

constexpr char emoji_8[] = "\xF0\x9F\x98\x80";
constexpr char emoji_u8[] = u8"\xF0\x9F\x98\x80";
constexpr wchar_t emoji_w[] = L"\U0001f600";

int main(void)
Expand All @@ -18,6 +19,11 @@ int main(void)
if (ascii.GetUTF8() != "latin1")
return 1;

UTFstring u8;
u8.SetUTF8( emoji_u8 );

UTFstring u8construct{emoji_u8};

UTFstring utf8;
utf8.SetUTF8( emoji_8 );

Expand Down

0 comments on commit 11c9c7a

Please sign in to comment.