File tree Expand file tree Collapse file tree 4 files changed +4
-3
lines changed
Expand file tree Collapse file tree 4 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ template <size_t N> struct fixed_string {
118118 if (info.length == 2 ) {
119119 if (++i < N) {
120120 if ((input[i] & 0b1111'1100'0000'0000 ) == 0b1101'1100'0000'0000 ) {
121- content[out++] = (info.value << 10 ) | (input[i] & 0b0000'0011'1111'1111 );
121+ content[out++] = (( info.value << 10 ) | (input[i] & 0b0000'0011'1111'1111 )) + 0x10000 ;
122122 } else {
123123 correct_flag = false ;
124124 break ;
Original file line number Diff line number Diff line change @@ -353,7 +353,7 @@ template <size_t N> struct fixed_string {
353353 if (info.length == 2) {
354354 if (++i < N) {
355355 if ((input[i] & 0b1111'1100'0000'0000) == 0b1101'1100'0000'0000) {
356- content[out++] = (info.value << 10) | (input[i] & 0b0000'0011'1111'1111);
356+ content[out++] = (( info.value << 10) | (input[i] & 0b0000'0011'1111'1111)) + 0x10000 ;
357357 } else {
358358 correct_flag = false;
359359 break;
Original file line number Diff line number Diff line change @@ -350,7 +350,7 @@ template <size_t N> struct fixed_string {
350350 if (info.length == 2 ) {
351351 if (++i < N) {
352352 if ((input[i] & 0b1111'1100'0000'0000 ) == 0b1101'1100'0000'0000 ) {
353- content[out++] = (info.value << 10 ) | (input[i] & 0b0000'0011'1111'1111 );
353+ content[out++] = (( info.value << 10 ) | (input[i] & 0b0000'0011'1111'1111 )) + 0x10000 ;
354354 } else {
355355 correct_flag = false ;
356356 break ;
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ static_assert(ctll::fixed_string(u8"😍")[0] == L'😍');
2626// u"" is utf-16
2727static_assert (ctll::fixed_string(u" ěšč" ).size() == 3 );
2828static_assert (ctll::fixed_string(u" 😍" ).size() == 1 );
29+ static_assert (ctll::fixed_string(u" 😍" ).is_same_as(ctll::fixed_string(U" 😍" )));
2930
3031// U"" is utf-32
3132static_assert (ctll::fixed_string(U" ěšč" ).size() == 3 );
You can’t perform that action at this time.
0 commit comments