bug-ncurses
[Top][All Lists]
Advanced

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

Re: a double-width character can transgress to the next row


From: Benno Schulenberg
Subject: Re: a double-width character can transgress to the next row
Date: Wed, 15 Apr 2020 12:18:46 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

Op 15-04-2020 om 01:56 schreef Thomas Dickey:
>> Now, going from dump number 4 to 5, the screen has narrowed again and
>> all rows lose an \s at the end -- except for row 21 and 25: they don't
>> lose the \u307f and \u7d0d at the end!  [...]
>>
>> So, it seems something goes wrong when ncurses shrinks a window: a
>> double-width character that overshoots the total width of the window
>> does not get replaced with a space (or something) but is left alone.
> 
> It's more complicated than that: some of the characters are "known"
> to be "fullwidth" (2 cells) and some are not.  It's not clear in the
> dump which are (so counting characters can be misleading).

Looking at all the characters in the ^R line and at

    http://unicode.org/reports/tr11-2/

all characters that are not space (and not ^ or R) are either in the
category Wide or in the category Fullwidth.  So most likely wcwidth()
will give 2 for all of those -- it ought to, otherwise nano wouldn't
draw things correctly when it redraws the screen.


Range 3041..3094 (Hiragana, wide):
  \u3044 \u304b \u3057 \u305f \u306b \u306e
  \u306e \u306f \u307e \u307f \u307f \u3089

Range 30A1..30FE (Katakana, wide):
  \u30a1 \u30a1 \u30a1 \u30a4 \u30c3 \u30c3
  \u30d0 \u30d0 \u30d5 \u30d5 \u30d5 \u30eb

Range 4E00..9FA5 (CJK ideograph, wide):
  \u4ed6 \u5728 \u65b0 \u73fe \u8aad \u8fbc

Range FF01..FF5E (fullwidth ASCII equivalents):
  \uff08 \uff09


> ...that's for the weekend - when I normally work on ncurses
>    (I'm doing maintenance on other stuff now)

Okay.  I'll be patient.  :)

Benno

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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