bug-ncurses
[Top][All Lists]
Advanced

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

Re: Double column width character written wrongly after refresh


From: Thomas Dickey
Subject: Re: Double column width character written wrongly after refresh
Date: Mon, 2 Jun 2003 14:53:10 -0400
User-agent: Mutt/1.2.5i

On Mon, Jun 02, 2003 at 11:21:17PM +0900, Mitsuru Chinen wrote:
> Thomas Dickey <address@hidden> wrote:
> > I've spent about an hour looking at this, but seem to be overlooking
> > something.  The gif file itself doesn't show a glitch.  However, running
> > your test program, I see some overlap effect which is probably what you're
> > talking about.
> 
> Excuse me for my poor explanation.
> As you've already found, my source code would display the full width
> 'b' on the right-hand side of the full width 'a'. And there would be
> no '#' between the 'a' and 'b'. But a '#' is displayed.

in my test, what I saw looked more like (since the unknown characters
were drawn with boxes)

        ##[[]##
 
but I'll retest on a more up-to-date platform.

> > Studying waddstr(), it seems that I should be able to
> > use mbrlen() to detect that the 3-character string is a single multibyte
> > character.  But it's returning a -2 (which says that it isn't working as
> > I thought.  I'll try later on a different platform (currently using libutf8
> > since this platform has some other things I needed to test).
> 
> Thank you so much for your investigation.
> 
> I suppose I found a lead to solve this defect.
> At 237 line in PutAttrChar() in ./ncurses/tty/tty_updates.c, sp->_curscol
> always increases by 1, even if a multi-column character is processed.
> This cause the difference between sp->_curscol and curscr->_curx.
> If sp->_curscol increases by wcwidth (ch->chars[0]), my sample program
> (fullwidth.c) works fine.

yes - that's because waddnstr() does not contain the proper code to handle
multibyte characters.  I think it should be doing some extra manipulation
(such as is done in waddnwstr()), but I overlooked it.
 
> But this solution is imperfect.
> The following sample code doesn't work correctly with this solution.
>   http://www.openi18n.org/~chinen/fullwidth2.c.gz

thanks (will test this, too).

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net




reply via email to

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