Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit cf14a35

Browse files
committed
Add u16string literals
Fixes error C2022: '55357': too big for character or similar errors
1 parent 17c3008 commit cf14a35

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

test/native/encoding-conversion-test.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -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

7373
TEST_CASE("EncodingConversion::encode - basic") {
@@ -93,7 +93,7 @@ TEST_CASE("EncodingConversion::encode - basic") {
9393

9494
TEST_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,7 +116,7 @@ TEST_CASE("EncodingConversion::encode - four-byte UTF-16 characters") {
116116

117117
TEST_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;
@@ -136,7 +136,7 @@ TEST_CASE("EncodingConversion::encode - invalid characters in the middle of the
136136

137137
TEST_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;

test/native/text-buffer-test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ TEST_CASE("TextBuffer::find_words_with_subsequence_in_range") {
467467
}
468468

469469
TEST_CASE("TextBuffer::has_astral") {
470-
REQUIRE(TextBuffer{u"ab" "\xd83d" "\xde01" "cd"}.has_astral());
470+
REQUIRE(TextBuffer{u"ab" u"\xd83d" u"\xde01" u"cd"}.has_astral());
471471
REQUIRE(!TextBuffer{u"abcd"}.has_astral());
472472
}
473473

0 commit comments

Comments
 (0)