[PATCH 2/3] fhandler_pty_slave::setup_locale: fall back to UTF-8, not ASCII

2020-09-01 Thread Johannes Schindelin
When we fail to determine the Console output code page to use in the Pseudo Console, we used to fall back to ASCII. However, a much better fall-back code page is UTF-8 because that's what Cygwin defaults to, internally, when no encoding was specified. Besides, `/etc/profile.d/lang.sh` essentially

[PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-01 Thread Johannes Schindelin
When `LANG=en_US.UTF-8`, the detected `LCID` is 0x0409, which is correct, but after that (at least if Pseudo Console support is enabled), we try to find the default code page for that `LCID`, which is ASCII (437). Subsequently, we set the Console output code page to that value, completely ignoring

[PATCH 1/3] fhandler_pty_slave::setup_locale: fix typo

2020-09-01 Thread Johannes Schindelin
Signed-off-by: Johannes Schindelin --- winsup/cygwin/fhandler_tty.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 6294e2c20..b3458595a 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler

[PATCH 0/3] pty: use the UTF-8 code page by default for non-Cygwin console applications

2020-09-01 Thread Johannes Schindelin
This patch series is the result of what was discussed in https://cygwin.com/pipermail/cygwin-developers/2020-September/011962.html While it is still not quite clear to me how the Console output code page is used under `disable_pcon` (when it was not used at all prior to the Pseudo Console patches,