NetBSD-Bugs archive

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

Re: bin/44455: vi doesn't handle unprintable characters

The following reply was made to PR bin/44455; it has been noted by GNATS.

From: Takehiko NOZAKI <>
Subject: Re: bin/44455: vi doesn't handle unprintable characters
Date: Sun, 30 Jan 2011 04:30:25 +0900

 > vi should show nonprintable characters as hexcodes, i.e \xe4 for an a-umlaut,
 > instead it shows \x00. The characters are inserted correctly, just the
 > display is bad.
 > I can repeat this only on big-endian machines (amiga, sparc64) but not on
 > others (amd64), the problem also exists in netbsd-5.
 > My guess is that for 8bit locales the first byte of a wchar_t is displayed
 > instead of the low byte.
 you are right, dist/nvi/common/keys.c v_key_name() is wrong.
 please try following patch:
 this patch contains several fixes i18n related bugs of nvi-1.81:
 1. fix PR/44455, nonprintable character doesn't show hex-visual under
 big endian.
 2. ":set octal" with nonprintable character causes nbwcurses move error.
 3. moving (big)words by wW/eE/bB can't handle non-ascii characters.
 4. toggle uppercase/lowercase by ~ can't handle non-ascii characters.
 5. don't feed CHAR_T(=wchar_t) to is* function directly.
   is* funcs with over UCHAR_MAX value may cause undefined behavior.
   some ctype implementation(such as FreeBSD) return unexpected
 result(same result as isw* func).
 6. using non-ascii digit character with count/line number of ex/vi
 command may causes unexpeced result.
 very truly yours
 Takehiko NOZAKI<>

Home | Main Index | Thread Index | Old Index