From ba3335bc5f3ce67e6fd9601b92f45b6311ebbf1c Mon Sep 17 00:00:00 2001 From: Dennis Duda Date: Sun, 1 Dec 2024 17:40:17 +0100 Subject: [PATCH] Fallbacks in `write_valid_utf8_to_console` - Allow dropping unknown characters. unicows just doesn't understand emojis :( - Ignore mismatched lengths when writing to console on non-Unicode Windows. (workaround for #13) --- library/std/src/sys/pal/windows/stdio.rs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/library/std/src/sys/pal/windows/stdio.rs b/library/std/src/sys/pal/windows/stdio.rs index 5cf437038a481..25693d65520a8 100644 --- a/library/std/src/sys/pal/windows/stdio.rs +++ b/library/std/src/sys/pal/windows/stdio.rs @@ -175,12 +175,15 @@ fn write_valid_utf8_to_console(handle: c::HANDLE, utf8: &str) -> io::Result io::Result