From fd26bd9bef46dca9e356a18cc590d60882d297d1 Mon Sep 17 00:00:00 2001 From: joboet Date: Fri, 19 Jun 2026 13:27:50 +0200 Subject: [PATCH] std: use correct low surrogate range in Windows standard I/O code --- library/std/src/sys/stdio/windows.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/std/src/sys/stdio/windows.rs b/library/std/src/sys/stdio/windows.rs index 62ec115d7b0cb..475a0592528b4 100644 --- a/library/std/src/sys/stdio/windows.rs +++ b/library/std/src/sys/stdio/windows.rs @@ -222,7 +222,7 @@ fn write_valid_utf8_to_console(handle: c::HANDLE, utf8: &str) -> io::Result io::Result 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, }; }