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>
This commit is contained in:
Corinna Vinschen 2016-10-19 12:48:40 +02:00
parent ba2851eeca
commit 5a3496c3e3
1 changed files with 2 additions and 0 deletions

View File

@ -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. */