ports/50374: [PATCH] chinese/irssi readline display error in Big5 terminal
Michael Hsin
mhsin at mhsin.org
Thu Mar 27 22:10:10 UTC 2003
>Number: 50374
>Category: ports
>Synopsis: [PATCH] chinese/irssi readline display error in Big5 terminal
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Mar 27 14:10:07 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: Michael Hsin
>Release: FreeBSD 4.6-STABLE i386
>Organization:
NTU CSIE
>Environment:
System: FreeBSD a.mhsin.org 4.6-STABLE FreeBSD 4.6-STABLE #3: Sat Mar 8 23:05:37 CST 2003 root at Ada.mhsin.org:/usr/obj/usr/src/sys/fake i386
>Description:
chinese/irssi's readline routines read and display strings one character
a time. This cause display problem in a real Big5 terminal (for example,
misc/screen with ^A :encoding big5 big5).
>How-To-Repeat:
Install and run misc/screen, type ^A and ":encoding big5 big5" to set
the encoding of screen. Then start chinese/irssi, key in some Chinese
words. Screen will "eat" higher bytes of Big5 characters. Pressing ^L
to redraw screen will correct the output.
>Fix:
The patch below:
--- src/fe-text/gui-readline.c.orig Mon Nov 11 15:00:02 2002
+++ src/fe-text/gui-readline.c Fri Mar 28 02:24:38 2003
@@ -50,6 +50,10 @@
static ENTRY_REDIRECT_REC *redir;
static int escape_next_key;
+static int big5high = FALSE;
+static unichar prekey = '\0';
+
+
static int readtag;
static time_t idle_time;
@@ -148,7 +152,25 @@
idle_time = time(NULL);
- if (key < 32) {
+ if(big5high || is_big5_hi(key))
+ {
+ if(big5high)
+ {
+ big5high = FALSE;
+ str[0] = prekey;
+ str[1] = key;
+ str[2] = '\0';
+ gui_entry_insert_text(active_entry, str);
+ return;
+ }
+ else
+ {
+ big5high = TRUE;
+ prekey = key;
+ return;
+ }
+ }
+ else if (key < 32) {
/* control key */
str[0] = '^';
str[1] = (char)key+'@';
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list