Bug
In library/std/src/sys/stdio/windows.rs, the low surrogate detection range is 0xDCEE..=0xDFFF instead of the correct 0xDC00..=0xDFFF.
This misses surrogates 0xDC00 through 0xDCED, causing:
- The trailing low surrogate of a split surrogate pair to not be flushed
- The UTF-8 byte count calculation to be wrong (counts 3 bytes instead of 1 for the low surrogate portion)
- The
Write trait to report fewer bytes written than consumed
Affects supplementary Unicode characters (emoji, CJK Extension B, mathematical symbols) written to the Windows console when the write buffer splits mid-surrogate pair.
Fix
Change both instances of 0xDCEE to 0xDC00 to cover the full low surrogate range.
Bug
In
library/std/src/sys/stdio/windows.rs, the low surrogate detection range is0xDCEE..=0xDFFFinstead of the correct0xDC00..=0xDFFF.This misses surrogates 0xDC00 through 0xDCED, causing:
Writetrait to report fewer bytes written than consumedAffects supplementary Unicode characters (emoji, CJK Extension B, mathematical symbols) written to the Windows console when the write buffer splits mid-surrogate pair.
Fix
Change both instances of
0xDCEEto0xDC00to cover the full low surrogate range.