From 58b338582927bf140dd9db2680a96559e4b29731 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Tue, 26 Dec 2023 10:32:02 +0100 Subject: [PATCH] test setting u8 string literals In C++20 it would use char8_t. --- test/test_utfstring.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test_utfstring.cxx b/test/test_utfstring.cxx index 637c4ee8..8a7b4f23 100644 --- a/test/test_utfstring.cxx +++ b/test/test_utfstring.cxx @@ -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) @@ -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 );