From 5a3496c3e3c159e6cfb4879f5adae1092927483f Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 19 Oct 2016 12:48:40 +0200 Subject: [PATCH] Fix regression in console charset handling Commit d16a5630 dropped usage of cygheap's locale functions in favor of local on-the-fly usage of UTF-8 instead of ASCII. This allowed to use the current local rather than a fixed system-wide locale set at startup time. d16a5630 just missed to add the ASCII->UTF-8 conversion in the console as well. Fixes https://cygwin.com/ml/cygwin/2016-10/msg00000.html Signed-off-by: Corinna Vinschen --- winsup/cygwin/fhandler_console.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 45fe8828b..2d281e023 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -2005,6 +2005,8 @@ fhandler_console::write_normal (const unsigned char *src, /* The alternate charset is always 437, just as in the Linux console. */ f_mbtowc = con.get_console_cp () ? __cp_mbtowc (437) : __MBTOWC; + if (f_mbtowc == __ascii_mbtowc) + f_mbtowc = __utf8_mbtowc; /* First check if we have cached lead bytes of a former try to write a truncated multibyte sequence. If so, process it. */