[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Surrogate pairs for addwstr?
From: |
Thomas Dickey |
Subject: |
Re: Surrogate pairs for addwstr? |
Date: |
Sat, 9 Oct 2021 16:32:11 -0400 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Sat, Oct 09, 2021 at 04:28:00PM -0400, Thomas Dickey wrote:
> On Sat, Oct 09, 2021 at 01:41:57PM -0400, Bill Gray wrote:
> > I tried feeding Unicode surrogate pairs to ncurses, and
> > nothing shows up (two blank characters are shown in xterm where
> > one combined SMP character ought to.) Test code is shown below.
> > When run with ncurses, the second treble shows up; the first one
> > doesn't.
>
> yes... surrogate pairs are neglected because they're not used on Unix-alike
> platforms - only with Windows (or Java). I'm aware that there's a gap with
https://www.gnu.org/software/libc/manual/html_node/Extended-Char-Intro.html
actually says
But in the GNU C Library wchar_t is always 32 bits wide and, therefore,
capable of representing all UCS-4 values and, therefore, covering all
of ISO 10646. Some Unix systems define wchar_t as a 16-bit type and
thereby follow Unicode very strictly. This definition is perfectly
fine with the standard, but it also means that to represent all
characters from Unicode and ISO 10646 one has to use UTF-16 surrogate
characters, which is in fact a multi-wide-character encoding. But
resorting to multi-wide-character encoding contradicts the purpose of
the wchar_t type.
but provides no example. In the cases where documentation is vague like that,
I've found it to be reporting second-hand information (unreliable).
--
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net
signature.asc
Description: PGP signature