newlib-cygwin/winsup
Johannes Schindelin 782aac590a Cygwin: console: Handle Unicode surrogate pairs.
When running Cygwin's Bash in the Windows Terminal (see
https://docs.microsoft.com/en-us/windows/terminal/ for details), Cygwin
is receiving keyboard input in the form of UTF-16 characters.

UTF-16 has that awkward challenge that it cannot map the full Unicode
range, and to make up for it, there are the ranges U+D800-U+DBFF and
U+DC00-U+DFFF which are illegal except when they come in a pair encoding
for Unicode characters beyond U+FFFF.

Cygwin does not handle such surrogate pairs correctly at the moment, as
can be seen e.g. when running Cygwin's Bash in the Windows Terminal and
then inserting an emoji (e.g. via Windows + <dot>, which opens an emoji
picker on recent Windows versions): Instead of showing an emoji, this
shows the infamous question mark in a black triangle, i.e. the invalid
Unicode character.

Let's special-case surrogate pairs in this scenario.

This fixes https://github.com/git-for-windows/git/issues/3281

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-11-16 23:20:43 +09:00
..
CVSChangeLogs.old
cygserver Cygwin: Allow using CFLAGS also for C++ files 2021-08-26 22:21:53 +02:00
cygwin Cygwin: console: Handle Unicode surrogate pairs. 2021-11-16 23:20:43 +09:00
doc Cygwin: document the recent pipe changes 2021-09-14 14:59:28 -04:00
testsuite Cygwin: testsuite: avoid "conflicting types" gcc warning 2021-09-03 12:15:53 +02:00
utils Cygwin: drop support for systems not supporting RFC 4646 locales 2021-10-29 18:19:45 +02:00
CONTRIBUTORS Cygwin: Add Ben Wijen to list of contributors 2021-01-18 12:01:19 +01:00
COPYING
COPYING.LIB Switching the Cygwin DLL to LGPLv3+, dropping commercial buyout option 2016-06-23 10:09:17 +02:00
CYGWIN_LICENSE Clarify source file license in CYGWIN_LICENSE 2016-06-23 21:52:12 +02:00
Makefile.am Cygwin: Use automake (v5) 2021-04-27 16:49:56 +01:00
Makefile.am.common Cygwin: automake: change @INCLUDES@ to @AM_CPPFLAGS@ to avoid warnings 2021-04-29 11:28:14 +02:00
README Fix typo and wrong URL in winsup/README 2016-05-24 10:25:18 +02:00
acinclude.m4 Cygwin: automake: change @INCLUDES@ to @AM_CPPFLAGS@ to avoid warnings 2021-04-29 11:28:14 +02:00
autogen.sh Cygwin: autogen.sh: Allow running from any directory 2021-05-06 10:56:20 +02:00
configure.ac Cygwin: Use automake (v5) 2021-04-27 16:49:56 +01:00

README

THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESSED OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

Cygwin documentation is available on the net at https://cygwin.com
You might especially be interested in

https://cygwin.com/faq/faq.html#faq.programming.building-cygwin