[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug report about addstr with cjk characters
From: |
WANG WenRui |
Subject: |
Re: bug report about addstr with cjk characters |
Date: |
Mon, 21 Mar 2005 01:47:40 +0800 |
User-agent: |
Mutt/1.5.6+20040907i |
Around 09 o'clock on 20 Mar, Thomas Dickey wrote:
>
> ok. The fragment we're discussing is (in lib_addch.c):
>
> if ((AttrOf(ch) & A_ALTCHARSET)
> || ((s = unctrl(t))[1] == 0 ||
> (
> isprint(t)
> #if USE_WIDEC_SUPPORT
> || WINDOW_EXT(win, addch_used)
> #endif
> )))
> return waddch_literal(win, ch);
>
> which should complement the Charable() macro in curses.priv.h (though I
> can't use the same logic exactly). The point is to make this call
> waddch_literal() when the value in t is part of a multibyte sequence.
>
> I think that something like this would do it:
>
> if ((AttrOf(ch) & A_ALTCHARSET)
> || (
> ((SP != 0 && SP->_legacy_coding)
> && (s = unctrl(t))[1] == 0)
> )
> || (
> isprint(t)
> #if USE_WIDEC_SUPPORT
> || WINDOW_EXT(win, addch_used)
> || !_nc_is_charable(CharOf(ch))
> #endif
> ))
> return waddch_literal(win, ch);
Hi,
These code works fine here. I've tested them against the newest
code from your site. There's one thing to be changed: the line
" SP->_legacy_coding " need to be protected by USE_WIDEC_SUPPORT
macro.
-----8<----------------------------------
if ((AttrOf(ch) & A_ALTCHARSET)
|| ((
#if USE_WIDEC_SUPPORT
(SP != 0 && SP->_legacy_coding) &&
#endif
(s = unctrl(t))[1] == 0)
)
|| (
isprint(t)
#if USE_WIDEC_SUPPORT
|| WINDOW_EXT(win, addch_used)
|| !_nc_is_charable(CharOf(ch))
#endif
))
return waddch_literal(win, ch);
------>8---------------------------------
Thanks
wwr
>
> and in ncurses.c test 'F' and 'f', that does indeed make it not display
> a tilde-character.
>
> However, I don't have a test-case for your locale.
>
> Perhaps you can test this change (preferably against the current code -
> see ftp://invisible-island.net/ncurses/5.4 for the rollup patch) and
> see if any additional changes are needed.
>
signature.asc
Description: Digital signature