File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -289,7 +289,8 @@ macro sz utf8_len_for_char16(Char16 c) @local
289289{
290290 switch
291291 {
292- case c & UTF16_SURROGATE_GENERIC_MASK == UTF16_SURROGATE_GENERIC_VALUE : return 4 ;
292+ case c & UTF16_SURROGATE_MASK == UTF16_SURROGATE_HIGH_VALUE : return 4 ;
293+ case c & UTF16_SURROGATE_MASK == UTF16_SURROGATE_LOW_VALUE : return 0 ;
293294 case c <= 0x7f : return 1 ;
294295 case c <= 0x7ff : return 2 ;
295296 default : return 3 ;
Original file line number Diff line number Diff line change 8787- ` conv::utf8to32 ` would not zero terminate in when the zero would be at the end of the buffer.
8888- ` char16_to_utf8_unsafe ` would not load low byte unaligned when required.
8989- Not all invalid UTF8 was detected.
90+ - UTF16 length detection was incorrect for utf16 with surrogate pairs.
9091
9192## 0.8.0 Change list
9293
You can’t perform that action at this time.
0 commit comments