bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Combining characters not applied to fullwidth characters


From: Thomas Dickey
Subject: Re: Combining characters not applied to fullwidth characters
Date: Sun, 22 May 2022 14:55:55 -0400
User-agent: Mutt/1.10.1 (2018-07-13)

On Sun, May 22, 2022 at 06:16:19PM +0100, Gavin Troy wrote:
> Hi,
> 
> It would seem combining characters are not correctly applied to fullwidth 
> characters when using the likes of addstr (or addwstr). From a glance at the 
> source it seems it is added to x-1 when it would need to be applied to x-2 
> for this case.
> 
> Example follows below using the following characters (although this selection 
> is arbitrary).
> U+30BB (KATAKANA LETTER SE)
> U+3099 (COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK)
> 
> This prints as セ rather than ゼ.
> 
> Gavin
> 
> 
> #include <locale.h>
> #include <curses.h>
> 
> int main (int argc, char *argv[]) {
>   setlocale(LC_CTYPE, "");
> 
>   initscr();
>   addstr("\xe3\x82\xbb\xe3\x82\x99\n");

hmm - in a quick check, I don't see the combining character coming out
in the output to the screen (which I suppose is the problem you're reporting).

Here's output with a 5x5 screen, to keep it manageable:

Script started on 2022-05-22 14:51:35-04:00 [TERM="screen.xterm-new" 
TTY="/dev/pts/2" COLUMNS="80" LINES="40"]
\n
\E[?1049h
\E[22;0;0t
\E[1;40r
\E(B
\E[m
\E[4l
\E[?7h
\E[H
\E[2J\343\202\273\r
\E[2d
\E[40;1H
\E[?1049l
\E[23;0;0t\r
\E[?1l
\E>
\nScript done on 2022-05-22 14:51:54-04:00 [COMMAND_EXIT_CODE="0"]
\n

>   clrtoeol();
>   getch();
>   endwin();
> 
>   return 0;
> }
> 

-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]