@@ -10,7 +10,7 @@ using std::u16string;
1010
1111TEST_CASE (" EncodingConversion::decode - basic UTF-8" ) {
1212 auto conversion = transcoding_from (" UTF-8" );
13- string input (" abγdefg\n hijklmnop" );
13+ string input (u8 " abγdefg\n hijklmnop" );
1414
1515 u16string string;
1616 conversion->decode (string, input.data (), input.size ());
@@ -42,7 +42,7 @@ TEST_CASE("EncodingConversion::decode - invalid byte sequences in the middle of
4242
4343 u16string string;
4444 conversion->decode (string, input.data (), input.size ());
45- REQUIRE (string == u" ab" " \ufffd " " \ufffd " " de" );
45+ REQUIRE (string == u" ab" u "\ufffd " u "\ufffd " u " de" );
4646}
4747
4848TEST_CASE (" EncodingConversion::decode - invalid byte sequences at the end of the input" ) {
@@ -58,7 +58,7 @@ TEST_CASE("EncodingConversion::decode - invalid byte sequences at the end of the
5858 string.clear ();
5959 bytes_encoded = conversion->decode (string, input.data (), input.size (), true );
6060 REQUIRE (bytes_encoded == 4 );
61- REQUIRE (string == u" ab" " \ufffd " " \ufffd " );
61+ REQUIRE (string == u" ab" u "\ufffd " u "\ufffd " );
6262}
6363
6464TEST_CASE (" EncodingConversion::decode - four-byte UTF-16 characters" ) {
@@ -67,7 +67,7 @@ TEST_CASE("EncodingConversion::decode - four-byte UTF-16 characters") {
6767
6868 u16string string;
6969 conversion->decode (string, input.data (), input.size ());
70- REQUIRE (string == u" ab" " \xd83d " " \xde01 " " cd" );
70+ REQUIRE (string == u" ab" u "\xd83d " u "\xde01 " u " cd" );
7171}
7272
7373TEST_CASE (" EncodingConversion::encode - basic" ) {
@@ -93,7 +93,7 @@ TEST_CASE("EncodingConversion::encode - basic") {
9393
9494TEST_CASE (" EncodingConversion::encode - four-byte UTF-16 characters" ) {
9595 auto conversion = transcoding_to (" UTF-8" );
96- u16string string = u" ab" " \xd83d " " \xde01 " " cd" ; // 'ab😁cd'
96+ u16string string = u" ab" u "\xd83d " u "\xde01 " u " cd" ; // 'ab😁cd'
9797
9898 vector<char > output (10 );
9999 size_t bytes_encoded = 0 , start = 0 ;
@@ -116,32 +116,32 @@ TEST_CASE("EncodingConversion::encode - four-byte UTF-16 characters") {
116116
117117TEST_CASE (" EncodingConversion::encode - invalid characters in the middle of the string" ) {
118118 auto conversion = transcoding_to (" UTF-8" );
119- u16string string = u" abc" " \xD800 " " def" ;
119+ u16string string = u" abc" u "\xD800 " u " def" ;
120120
121121 vector<char > output (10 );
122122 size_t bytes_encoded = 0 , start = 0 ;
123123
124124 bytes_encoded = conversion->encode (
125125 string, &start, string.size (), output.data (), output.size ());
126- REQUIRE (std::string (output.data (), bytes_encoded) == " abc" " \ufffd " " def" );
126+ REQUIRE (std::string (output.data (), bytes_encoded) == u8 " abc" u8 "\ufffd " u8 " def" );
127127
128128 // Here, the invalid character occurs at the end of a chunk.
129129 start = 0 ;
130130 bytes_encoded = conversion->encode (
131131 string, &start, 4 , output.data (), output.size ());
132132 bytes_encoded += conversion->encode (
133133 string, &start, string.size (), output.data () + bytes_encoded, output.size () - bytes_encoded);
134- REQUIRE (std::string (output.data (), bytes_encoded) == " abc" " \ufffd " " def" );
134+ REQUIRE (std::string (output.data (), bytes_encoded) == u8 " abc" u8 "\ufffd " u8 " def" );
135135}
136136
137137TEST_CASE (" EncodingConversion::encode - invalid characters at the end of the string" ) {
138138 auto conversion = transcoding_to (" UTF-8" );
139- u16string string = u" abc" " \xD800 " ;
139+ u16string string = u" abc" u "\xD800 " ;
140140
141141 vector<char > output (10 );
142142 size_t bytes_encoded = 0 , start = 0 ;
143143
144144 bytes_encoded = conversion->encode (
145145 string, &start, string.size (), output.data (), output.size (), true );
146- REQUIRE (std::string (output.data (), bytes_encoded) == " abc" " \ufffd " );
146+ REQUIRE (std::string (output.data (), bytes_encoded) == u8 " abc" u8 "\ufffd " );
147147}
0 commit comments