summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_console.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2016-10-19 12:48:40 +0200
committerCorinna Vinschen <corinna@vinschen.de>2016-10-19 12:52:14 +0200
commit5a3496c3e3c159e6cfb4879f5adae1092927483f (patch)
treeb74ca8421ecb4df66d1f5b6ae52544e0cb07b3ff /winsup/cygwin/fhandler_console.cc
parentba2851eecacd79d6ec4083bdf1d38b2a53cabdd7 (diff)
downloadcygnal-5a3496c3e3c159e6cfb4879f5adae1092927483f.tar.gz
cygnal-5a3496c3e3c159e6cfb4879f5adae1092927483f.tar.bz2
cygnal-5a3496c3e3c159e6cfb4879f5adae1092927483f.zip
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 <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/fhandler_console.cc')
-rw-r--r--winsup/cygwin/fhandler_console.cc2
1 files changed, 2 insertions, 0 deletions
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. */