urxvt-unicode shows some Japanese FULLWIDTH chars as HALFWIDTH

Dai.H. dg-f at users.sourceforge.net
Sat Nov 4 06:38:34 CET 2006


On Fri, Nov 03, 2006 at 06:24:33PM +0100, Marc Lehmann wrote:
> On Fri, Nov 03, 2006 at 12:41:44AM -0800, "Dai.H." <dg-f at users.sourceforge.net> wrote:
> > Some of Japanese FULLWIDTH symbol chars shown as HALFWIDTH.
> urxvt uses whatever you tell it to use. If the locale you chose says
> halfwidth, urxvt does halfwidth, if it says fullwidth, it does fullwidth.

# http://vdlinux.sourceforge.jp/dists/urxvt/symbols.txt

In ja_JP.EUC-JP locale, some chars are shown as FULLWIDTH,
some are shown as HALFWIDTH.
In ja_JP.UTF-8 locale, all chars are shown as HALFWIDTH.

> > But Japanese terminal application treats them as FULLWIDTH, example vim.
> My debian vim installation (7.0-035+1) correctly respects the locale with,
> as should any well-written program do (xterm does not, which is a real
> problem).

In ja_JP.EUC-JP locale, my Debian vim 7.0-152+1 sets

:set encoding=euc-jp
:set termencoding=euc-jp
:set ambiwidth=double

almost chars are shown as FULLWIDTH, some are shown as HALFWIDTH.
But all chars are treated as FULLWIDTH.

In ja_JP.UTF-8 locale, my Debian vim 7.0-152+1 sets

:set encoding=utf-8
:set termencoding=utf-8
:set ambiwidth=double

all chars are shown as HALFWIDTH, but treated as FULLWIDTH.

> > Would you please support this feature?
> This is already being supported for a long time. You have to use the
> correct locale, and all correct programs will automatically adjust. Add a
> dire hack breaks all programs that correctly respect the locale. Breaking
> each and every program with such an option is a bad idea.
> Which locale that is and how to enable it depends on your operating
> system. The issue itself has nothing to do with urxvt.

In src/rxvt.h

> // for speed reasons, we assume that all latin1 characters
> // are single-width (the first unicode combining character
> // is actually 0x300, but ascii is what matters most).
> #define WCWIDTH(c) ((c) & ~0xff ? wcwidth (c) : 1)

For example, 0xa7 is Latin-1 Supplement and East Asian Ambiguous.
I expect 0xa7 is width 2.
I add dirty code that overwritting width to
rxvt_term::scr_add_lines in src/screen.C.

I do not know detail and if I am wrong, please correct me.


More information about the rxvt-unicode mailing list