Jacek Caban : hostname: Use CP_ACP for non-console output encoding.

Alexandre Julliard julliard at winehq.org
Fri Nov 13 15:57:52 CST 2020


Module: wine
Branch: master
Commit: bf6e8815ded939c7f16559966b46f2ad1b9fa716
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=bf6e8815ded939c7f16559966b46f2ad1b9fa716

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Nov 12 20:38:08 2020 +0100

hostname: Use CP_ACP for non-console output encoding.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/hostname/hostname.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/programs/hostname/hostname.c b/programs/hostname/hostname.c
index e6c2ed76cd1..812703d909d 100644
--- a/programs/hostname/hostname.c
+++ b/programs/hostname/hostname.c
@@ -47,14 +47,13 @@ static int hostname_vprintfW(const WCHAR *msg, __ms_va_list va_args)
          * back to WriteFile(), assuming the console encoding is still the right
          * one in that case.
          */
-        len = WideCharToMultiByte(GetConsoleOutputCP(), 0, msg_buffer, wlen,
+        len = WideCharToMultiByte(CP_ACP, 0, msg_buffer, wlen,
             NULL, 0, NULL, NULL);
         msgA = HeapAlloc(GetProcessHeap(), 0, len);
         if (!msgA)
             return 0;
 
-        WideCharToMultiByte(GetConsoleOutputCP(), 0, msg_buffer, wlen, msgA, len,
-            NULL, NULL);
+        WideCharToMultiByte(CP_ACP, 0, msg_buffer, wlen, msgA, len, NULL, NULL);
         WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), msgA, len, &count, FALSE);
         HeapFree(GetProcessHeap(), 0, msgA);
     }




More information about the wine-cvs mailing list