Date: Sun, 18 Mar 2001 22:11:19 +0800 (CST) From: leeym@bsd.ce.ntu.edu.tw To: FreeBSD-gnats-submit@freebsd.org Cc: keichii@freebsd.org Subject: bin/25895: Add Big5 multibyte support for tcsh Message-ID: <200103181411.f2IEBIx41325@utopia.leeym.com>
next in thread | raw e-mail | index | archive | help
>Number: 25895 >Category: bin >Synopsis: Add Big5 multibyte support for tcsh >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Mar 18 06:20:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Yen-Ming Lee >Release: FreeBSD 4.3-BETA i386 >Organization: Ga-Ga-Wu-La-La, Blah-Blah-Walah-Walah... Nothing. >Environment: System: FreeBSD utopia.leeym.com 4.3-BETA FreeBSD 4.3-BETA #2: Wed Mar 14 13:10:32 CST 2001 root@utopia.leeym.com:/home/system/obj/home/system/src/sys/UTOPIA i386 >Description: Add Big5 multibyte support for tcsh. To enable Big5 code, please set dspmbyte to big5 $ set dspmbyte = "big5" >How-To-Repeat: >Fix: --- sh.char.c.orig Sun Mar 18 20:52:40 2001 +++ sh.char.c Sun Mar 18 21:19:55 2001 @@ -813,6 +813,61 @@ _MB1|_MB2, 0, 0, 0, }; +/* Add by Yen-Ming Lee <leeym@cae.ce.ntu.edu.tw> */ +unsigned short _mbmap_big5[256] = { +/* first byte 0xa1 - 0xfe */ +/* second byte 0x40 - 0x7e, 0xa1 - 0xfe */ +/* 0x00-0x3f = 0, 0x40-0x7e = 2, 0x7f-0xa0 = 0, 0xa1-0xfe = 3, 0xff = 0 */ +/* 0x00 - 0x3f = 0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +/* 0x40 - 0x7e = 2 */ + _MB2, _MB2, _MB2, _MB2, + _MB2, _MB2, _MB2, _MB2, + _MB2, _MB2, _MB2, _MB2, + _MB2, _MB2, _MB2, _MB2, + _MB2, _MB2, _MB2, _MB2, + _MB2, _MB2, _MB2, _MB2, + _MB2, _MB2, _MB2, _MB2, + _MB2, _MB2, _MB2, _MB2, + _MB2, _MB2, _MB2, _MB2, + _MB2, _MB2, _MB2, _MB2, + _MB2, _MB2, _MB2, _MB2, + _MB2, _MB2, _MB2, _MB2, + _MB2, _MB2, _MB2, _MB2, + _MB2, _MB2, _MB2, _MB2, + _MB2, _MB2, _MB2, _MB2, + /* 0x7f - 0xa0 = 0 */ + _MB2, _MB2, _MB2, 0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + /* a1 - fe = 3 */ + 0, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, + /* 0xff = 0 */ + _MB1|_MB2, _MB1|_MB2, _MB1|_MB2, 0, +}; + #else /* !(defined(KANJI) && defined(SHORT_STRINGS) && defined(DSPMBYTE)) */ unsigned short _cmap[256] = { /* 0 nul 1 soh 2 stx 3 etx */ --- sh.char.h.orig Sun Mar 18 21:23:26 2001 +++ sh.char.h Sun Mar 18 21:23:42 2001 @@ -58,6 +58,7 @@ extern unsigned short _mbmap[]; extern unsigned short _mbmap_euc[]; extern unsigned short _mbmap_sjis[]; +extern unsigned short _mbmap_big5[]; /* VARIABLE Check str */ /* same compiler require #define even not define DSPMBYTE */ #define _MB1 0x0001 --- sh.set.c.orig Sun Mar 18 20:53:40 2001 +++ sh.set.c Sun Mar 18 21:29:29 2001 @@ -1103,6 +1103,8 @@ iskcode = 1; else if (eq(dstr1, STRKEUC)) iskcode = 2; + else if (eq(dstr1, STRKBIG5)) + iskcode = 3; else if ((dstr1[0] - '0') >= 0 && (dstr1[0] - '0') <= 3) { iskcode = 0; } @@ -1127,6 +1129,11 @@ _cmap[lp] = _cmap_mbyte[lp]; _mbmap[lp] = _mbmap_euc[lp]; break; + case 3: + /* 3 ... big5 */ + _cmap[lp] = _cmap_mbyte[lp]; + _mbmap[lp] = _mbmap_big5[lp]; + break; default: xprintf(CGETS(18, 3, "Warning: unknown multibyte code %d; multibyte disabled\n"), @@ -1204,6 +1211,7 @@ { STRLANGEUCKRB, STRKEUC }, { STRLANGSJIS, STRKSJIS }, { STRLANGSJISB, STRKSJIS }, + { STRLANGBIG5, STRKBIG5 }, { NULL, NULL } }; --- tc.const.c.orig Sun Mar 18 20:54:26 2001 +++ tc.const.c Sun Mar 18 21:42:50 2001 @@ -125,6 +125,7 @@ Char STRmmliteral[] = { '-', '-', 'l', 'i', 't', 'e', 'r', 'a', 'l', '\0' }; Char STRKEUC[] = { 'e', 'u', 'c', '\0' }; Char STRKSJIS[] = { 's', 'j', 'i', 's', '\0' }; +Char STRKBIG5[] = { 'b', 'i', 'g', '5', '\0' }; # ifdef MBYTEDEBUG /* Sorry, use for beta testing */ Char STRmbytemap[] = { 'm', 'b', 'y', 't', 'e', 'm', 'a', 'p', '\0' }; # endif /* MBYTEMAP */ @@ -153,6 +154,8 @@ Char STRLANGSJIS[] = { 'j', 'a', '_', 'J', 'P', '.', 'S', 'J', 'I', 'S', '\0' }; Char STRLANGSJISB[] = { '\0' }; +Char STRLANGBIG5[] = { 'z', 'h', '_', 'T', 'W', '.', 'B', 'i', 'g', '5', + '\0' }; # elif defined(linux) Char STRLANGEUC[] = { 'j', 'a', '_', 'J', 'P', '.', 'e', 'u', 'c', 'J', 'P', '\0' }; @@ -161,6 +164,7 @@ Char STRLANGSJIS[] = { 'j', 'a', '_', 'J', 'P', '.', 'S', 'J', 'I', 'S', '\0' }; Char STRLANGSJISB[] = { '\0' }; +Char STRLANGBIG5[] = { '\0' }; # elif defined(__uxpm__) Char STRLANGEUCJP[] = { 'j', 'a', 'p', 'a', 'n', '\0' }; Char STRLANGEUCKR[] = { 'k', 'o', 'r', 'e', 'a', '\0' }; @@ -168,6 +172,7 @@ Char STRLANGEUCKRB[] = { '\0' }; Char STRLANGSJIS[] = { '\0' }; Char STRLANGSJISB[] = { '\0' }; +Char STRLANGBIG5[] = { '\0' }; # elif defined(SOLARIS2) Char STRLANGEUCJP[] = { 'j', 'a', '\0' }; Char STRLANGEUCKR[] = { 'k', 'o', '\0' }; @@ -175,6 +180,7 @@ Char STRLANGEUCKRB[] = { 'k', 'o', 'r', 'e', 'a', 'n', '\0' }; Char STRLANGSJIS[] = { '\0' }; Char STRLANGSJISB[] = { '\0' }; +Char STRLANGBIG5[] = { '\0' }; # elif defined(hpux) Char STRLANGEUCJP[] = { 'j', 'a', '_', 'J', 'P', '.', 'e', 'u', 'c', 'J', 'P' }; Char STRLANGEUCKR[] = { 'k', 'o', '_', 'K', 'R', '.', 'e', 'u', 'c', 'K', 'R' }; @@ -182,6 +188,7 @@ Char STRLANGEUCKRB[] = { '\0' }; Char STRLANGSJIS[] = { '\0' }; Char STRLANGSJISB[] = { '\0' }; +Char STRLANGBIG5[] = { '\0' }; # else Char STRLANGEUCJP[] = { '\0' }; Char STRLANGEUCKR[] = { '\0' }; @@ -189,6 +196,7 @@ Char STRLANGEUCKRB[] = { '\0' }; Char STRLANGSJIS[] = { '\0' }; Char STRLANGSJISB[] = { '\0' }; +Char STRLANGBIG5[] = { '\0' }; # endif # endif /* defined(DSPMBYTE) */ #endif >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103181411.f2IEBIx41325>