From a71866aebb402d4f6a1ea64272f5295723e1ffe7 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 21 Nov 2024 12:43:50 +0000 Subject: [PATCH] Disable UTF-8 console handling on pre-NT Windows. The w32old builds couldn't read a password from the console at all, because ReadConsoleW would always return failure. --- windows/console.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/windows/console.c b/windows/console.c index 13f54243..7b9e11bf 100644 --- a/windows/console.c +++ b/windows/console.c @@ -78,7 +78,13 @@ static ConsoleIO *conio_setup(bool utf8) conio->hin = conio->hout = INVALID_HANDLE_VALUE; conio->need_close_hin = conio->need_close_hout = false; - conio->utf8 = utf8 && conio_use_utf8; + + init_winver(); + if (osPlatformId == VER_PLATFORM_WIN32_WINDOWS || + osPlatformId == VER_PLATFORM_WIN32s) + conio->utf8 = false; /* no Unicode support at all */ + else + conio->utf8 = utf8 && conio_use_utf8; /* * First try opening the console itself, so that prompts will go