Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions library/std/src/sys/stdio/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ fn write_valid_utf8_to_console(handle: c::HANDLE, utf8: &str) -> io::Result<usiz
// write the missing surrogate out now.
// Buffering it would mean we have to lie about the number of bytes written.
let first_code_unit_remaining = utf16[written];
if matches!(first_code_unit_remaining, 0xDCEE..=0xDFFF) {
if matches!(first_code_unit_remaining, 0xDC00..=0xDFFF) {
// low surrogate
// We just hope this works, and give up otherwise
let _ = write_u16s(handle, &utf16[written..written + 1]);
Expand All @@ -234,7 +234,7 @@ fn write_valid_utf8_to_console(handle: c::HANDLE, utf8: &str) -> io::Result<usiz
count += match ch {
0x0000..=0x007F => 1,
0x0080..=0x07FF => 2,
0xDCEE..=0xDFFF => 1, // Low surrogate. We already counted 3 bytes for the other.
0xDC00..=0xDFFF => 1, // Low surrogate. We already counted 3 bytes for the other.
_ => 3,
};
}
Expand Down
Loading