conf/93844: [PATCH] add SWIDTH to zh_TW.Big5 locale, fix problem with tcsh

Rong-En Fan rafan at infor.org
Sat Feb 25 15:20:04 PST 2006


>Number:         93844
>Category:       conf
>Synopsis:       [PATCH] add SWIDTH to zh_TW.Big5 locale, fix problem with tcsh
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 25 23:20:02 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Rong-En Fan
>Release:        FreeBSD 6.0-RELEASE-p4 i386
>Organization:
NTU CSIE 
>Environment:


	
>Description:
	If tcsh is started with zh_TW.Big5 locale, erasing a big5 character
	will result in dirty screen. It should erase two bytes, but it
	erases only one byte.

	
>How-To-Repeat:
	env LANG=zh_TW.Big5 LC_CTYPE=zh_TW.Big5 tcsh
	tcsh> /type some Big5 characters/ and then use backspace
	
>Fix:
	This is due to our zh_TW.Big5 locale does not have SWIDTH definition.
	Similar to jp_JP.eucJP, ko_KR.eucKR locale, which ume@ added
	SWIDTH definition recently, add SWIDTH definition to zh_TW.Big5 locale.

	The changes are in fact added from scrach and then I did a check
	with NetBSD's, they are similar. (Some range in their Big5 locale
	is not correct, FreeBSD's is correct). This patch is tested by myself
	and Yu-Yen Ou <yien __at__ csie.org>.

	I really hope this patch and those for jp, ko locale can be
	merged into 6.1-RELEASE (or even 5.5-RELEASE). This helps CJK
	people a lot :-)


--- share/mklocale/zh_TW.Big5.src.orig	Fri Dec 21 02:58:16 2001
+++ share/mklocale/zh_TW.Big5.src	Sun Feb 26 03:33:17 2006
@@ -22,6 +22,7 @@
 XDIGIT          '0' - '9' 'a' - 'f' 'A' - 'F'
 BLANK		' ' '\t'
 PRINT		0x20 - 0x7e
+SWIDTH1		0x20 - 0x7e
 
 MAPLOWER       	< 'A' - 'Z' : 'a' >
 MAPLOWER       	< 'a' - 'z' : 'a' >
@@ -36,11 +37,14 @@
  */
 
 PUNCT           0xa141 - 0xa17e 0xa1a1 - 0xa1ac
+SWIDTH2         0xa141 - 0xa17e 0xa1a1 - 0xa1ac
 
 SPECIAL         0xa1ad - 0xa1fe 0xa240 - 0xa27e 0xa2a1 - 0xa2ae
+SWIDTH2         0xa1ad - 0xa1fe 0xa240 - 0xa27e 0xa2a1 - 0xa2ae
 
 /* full width 0 1 2 .. 9 */
 /* ?DIGIT           0xa2af - 0xa2b8 */
+/* SWIDTH2          0xa2af - 0xa2b8 */
 
 /* map these (SuChou Code (12) and Roman (I II etc.) number (10)) to digits */
 TODIGIT         < 0xa2b9 - 0xa2c2 : 1 >
@@ -50,6 +54,8 @@
 /* note the lower case alphabets are not continuous */
 UPPER           0xa2cf - 0xa2e8
 LOWER           0xa2e9 - 0xa2fe 0xa340 - 0xa343
+SWIDTH2         0xa2cf - 0xa2e8
+SWIDTH2         0xa2e9 - 0xa2fe 0xa340 - 0xa343
 
 /* we have to got two line for each 'cause they are not continuous */
 MAPLOWER        < 0xa2cf - 0xa2e4 : 0xa2e9 > < 0xa2e5 - 0xa2e8 : 0xa340 >
@@ -58,25 +64,33 @@
 MAPUPPER        < 0xa2e9 - 0xa2fe : 0xa2cf > < 0xa340 - 0xa343 : 0xa2e5 >
 
 /* ?XDIGIT          0xa2cf - 0xa2d4 0xa2e9 - 0xa2ee */
+/* SWIDTH2          0xa2cf - 0xa2d4 0xa2e9 - 0xa2ee */
 
 SPACE           0xa3bc
 BLANK           0xa3bc
+SWIDTH2         0xa3bc
 /* bopomofo symbols */
 PHONOGRAM       0xa374 - 0xa37e 0xa3a1 - 0xa3bb
+SWIDTH2         0xa374 - 0xa37e 0xa3a1 - 0xa3bb
 /* tone symbols */
 PHONOGRAM       0xa3bd - 0xa3bf
+SWIDTH2         0xa3bd - 0xa3bf
 /* control */
 CONTROL         0xa3c0 - 0xa3fe
 
 /* greek */
 UPPER           0xa344 - 0xa35b
 LOWER           0xa35c - 0xa373
+SWIDTH2         0xa344 - 0xa35b
+SWIDTH2         0xa35c - 0xa373
 MAPUPPER        < 0xa344 - 0xa35b : 0xa344 > < 0xa35c - 0xa373 : 0xa344 >
 MAPLOWER        < 0xa344 - 0xa35b : 0xa35c > < 0xa35c - 0xa373 : 0xa35c >
 
 /* cyrillic (russian etc) */
 UPPER           0xc7f3 - 0xc7fe 0xc840 - 0xc854
 LOWER           0xc855 - 0xc875
+SWIDTH2         0xc7f3 - 0xc7fe 0xc840 - 0xc854
+SWIDTH2         0xc855 - 0xc875
 MAPUPPER        < 0xc7f3 - 0xc7fe : 0xc7f3 > < 0xc840 - 0xc854 : 0xc840 >
 MAPUPPER        < 0xc855 - 0xc860 : 0xc7f3 > < 0xc861 - 0xc875 : 0xc840 >
 MAPLOWER        < 0xc7f3 - 0xc7fe : 0xc855 > < 0xc840 - 0xc854 : 0xc861 >
@@ -118,6 +132,42 @@
 IDEOGRAM        0xc540 - 0xc57e 0xc5a1 - 0xc5fe
 IDEOGRAM        0xc640 - 0xc67e
 
+SWIDTH2         0xa440 - 0xa47e 0xa4a1 - 0xa4fe
+SWIDTH2         0xa540 - 0xa57e 0xa5a1 - 0xa5fe
+SWIDTH2         0xa640 - 0xa67e 0xa6a1 - 0xa6fe
+SWIDTH2         0xa740 - 0xa77e 0xa7a1 - 0xa7fe
+SWIDTH2         0xa840 - 0xa87e 0xa8a1 - 0xa8fe
+SWIDTH2         0xa940 - 0xa97e 0xa9a1 - 0xa9fe
+SWIDTH2         0xaa40 - 0xaa7e 0xaaa1 - 0xaafe
+SWIDTH2         0xab40 - 0xab7e 0xaba1 - 0xabfe
+SWIDTH2         0xac40 - 0xac7e 0xaca1 - 0xacfe
+SWIDTH2         0xad40 - 0xad7e 0xada1 - 0xadfe
+SWIDTH2         0xae40 - 0xae7e 0xaea1 - 0xaefe
+SWIDTH2         0xaf40 - 0xaf7e 0xafa1 - 0xaffe
+SWIDTH2         0xb040 - 0xb07e 0xb0a1 - 0xb0fe
+SWIDTH2         0xb140 - 0xb17e 0xb1a1 - 0xb1fe
+SWIDTH2         0xb240 - 0xb27e 0xb2a1 - 0xb2fe
+SWIDTH2         0xb340 - 0xb37e 0xb3a1 - 0xb3fe
+SWIDTH2         0xb440 - 0xb47e 0xb4a1 - 0xb4fe
+SWIDTH2         0xb540 - 0xb57e 0xb5a1 - 0xb5fe
+SWIDTH2         0xb640 - 0xb67e 0xb6a1 - 0xb6fe
+SWIDTH2         0xb740 - 0xb77e 0xb7a1 - 0xb7fe
+SWIDTH2         0xb840 - 0xb87e 0xb8a1 - 0xb8fe
+SWIDTH2         0xb940 - 0xb97e 0xb9a1 - 0xb9fe
+SWIDTH2         0xba40 - 0xba7e 0xbaa1 - 0xbafe
+SWIDTH2         0xbb40 - 0xbb7e 0xbba1 - 0xbbfe
+SWIDTH2         0xbc40 - 0xbc7e 0xbca1 - 0xbcfe
+SWIDTH2         0xbd40 - 0xbd7e 0xbda1 - 0xbdfe
+SWIDTH2         0xbe40 - 0xbe7e 0xbea1 - 0xbefe
+SWIDTH2         0xbf40 - 0xbf7e 0xbfa1 - 0xbffe
+SWIDTH2         0xc040 - 0xc07e 0xc0a1 - 0xc0fe
+SWIDTH2         0xc140 - 0xc17e 0xc1a1 - 0xc1fe
+SWIDTH2         0xc240 - 0xc27e 0xc2a1 - 0xc2fe
+SWIDTH2         0xc340 - 0xc37e 0xc3a1 - 0xc3fe
+SWIDTH2         0xc440 - 0xc47e 0xc4a1 - 0xc4fe
+SWIDTH2         0xc540 - 0xc57e 0xc5a1 - 0xc5fe
+SWIDTH2         0xc640 - 0xc67e
+
 IDEOGRAM        0xc940 - 0xc97e 0xc9a1 - 0xc9fe
 IDEOGRAM        0xca40 - 0xca7e 0xcaa1 - 0xcafe
 IDEOGRAM        0xcb40 - 0xcb7e 0xcba1 - 0xcbfe
@@ -168,33 +218,91 @@
 IDEOGRAM        0xf840 - 0xf87e 0xf8a1 - 0xf8fe
 IDEOGRAM        0xf940 - 0xf97e 0xf9a1 - 0xf9dc
 
+SWIDTH2         0xc940 - 0xc97e 0xc9a1 - 0xc9fe
+SWIDTH2         0xca40 - 0xca7e 0xcaa1 - 0xcafe
+SWIDTH2         0xcb40 - 0xcb7e 0xcba1 - 0xcbfe
+SWIDTH2         0xcc40 - 0xcc7e 0xcca1 - 0xccfe
+SWIDTH2         0xcd40 - 0xcd7e 0xcda1 - 0xcdfe
+SWIDTH2         0xce40 - 0xce7e 0xcea1 - 0xcefe
+SWIDTH2         0xcf40 - 0xcf7e 0xcfa1 - 0xcffe
+SWIDTH2         0xd040 - 0xd07e 0xd0a1 - 0xd0fe
+SWIDTH2         0xd140 - 0xd17e 0xd1a1 - 0xd1fe
+SWIDTH2         0xd240 - 0xd27e 0xd2a1 - 0xd2fe
+SWIDTH2         0xd340 - 0xd37e 0xd3a1 - 0xd3fe
+SWIDTH2         0xd440 - 0xd47e 0xd4a1 - 0xd4fe
+SWIDTH2         0xd540 - 0xd57e 0xd5a1 - 0xd5fe
+SWIDTH2         0xd640 - 0xd67e 0xd6a1 - 0xd6fe
+SWIDTH2         0xd740 - 0xd77e 0xd7a1 - 0xd7fe
+SWIDTH2         0xd840 - 0xd87e 0xd8a1 - 0xd8fe
+SWIDTH2         0xd940 - 0xd97e 0xd9a1 - 0xd9fe
+SWIDTH2         0xda40 - 0xda7e 0xdaa1 - 0xdafe
+SWIDTH2         0xdb40 - 0xdb7e 0xdba1 - 0xdbfe
+SWIDTH2         0xdc40 - 0xdc7e 0xdca1 - 0xdcfe
+SWIDTH2         0xdd40 - 0xdd7e 0xdda1 - 0xddfe
+SWIDTH2         0xde40 - 0xde7e 0xdea1 - 0xdefe
+SWIDTH2         0xdf40 - 0xdf7e 0xdfa1 - 0xdffe
+SWIDTH2         0xe040 - 0xe07e 0xe0a1 - 0xe0fe
+SWIDTH2         0xe140 - 0xe17e 0xe1a1 - 0xe1fe
+SWIDTH2         0xe240 - 0xe27e 0xe2a1 - 0xe2fe
+SWIDTH2         0xe340 - 0xe37e 0xe3a1 - 0xe3fe
+SWIDTH2         0xe440 - 0xe47e 0xe4a1 - 0xe4fe
+SWIDTH2         0xe540 - 0xe57e 0xe5a1 - 0xe5fe
+SWIDTH2         0xe640 - 0xe67e 0xe6a1 - 0xe6fe
+SWIDTH2         0xe740 - 0xe77e 0xe7a1 - 0xe7fe
+SWIDTH2         0xe840 - 0xe87e 0xe8a1 - 0xe8fe
+SWIDTH2         0xe940 - 0xe97e 0xe9a1 - 0xe9fe
+SWIDTH2         0xea40 - 0xea7e 0xeaa1 - 0xeafe
+SWIDTH2         0xeb40 - 0xeb7e 0xeba1 - 0xebfe
+SWIDTH2         0xec40 - 0xec7e 0xeca1 - 0xecfe
+SWIDTH2         0xed40 - 0xed7e 0xeda1 - 0xedfe
+SWIDTH2         0xee40 - 0xee7e 0xeea1 - 0xeefe
+SWIDTH2         0xef40 - 0xef7e 0xefa1 - 0xeffe
+SWIDTH2         0xf040 - 0xf07e 0xf0a1 - 0xf0fe
+SWIDTH2         0xf140 - 0xf17e 0xf1a1 - 0xf1fe
+SWIDTH2         0xf240 - 0xf27e 0xf2a1 - 0xf2fe
+SWIDTH2         0xf340 - 0xf37e 0xf3a1 - 0xf3fe
+SWIDTH2         0xf440 - 0xf47e 0xf4a1 - 0xf4fe
+SWIDTH2         0xf540 - 0xf57e 0xf5a1 - 0xf5fe
+SWIDTH2         0xf640 - 0xf67e 0xf6a1 - 0xf6fe
+SWIDTH2         0xf740 - 0xf77e 0xf7a1 - 0xf7fe
+SWIDTH2         0xf840 - 0xf87e 0xf8a1 - 0xf8fe
+SWIDTH2         0xf940 - 0xf97e 0xf9a1 - 0xf9dc
+
 /* Eten external charset 0xc6a1 - 0xc8d3 */
 
 /* lots strange numbers */
 SPECIAL         0xc6a1 - 0xc6be
+SWIDTH2         0xc6a1 - 0xc6be
 
 TODIGIT         < 0xc6a1 - 0xc6aa : 1 > < 0xc6ab - 0xc6b4 : 1 >
 TODIGIT         < 0xc6b5 - 0xc6be : 1>
 
 /* these are HanZi Radicals */
 SPECIAL         0xc6bf - 0xc6d7 0xc879 - 0xc87e 0xc8a1 - 0xc8a4
+SWIDTH2         0xc6bf - 0xc6d7 0xc879 - 0xc87e 0xc8a1 - 0xc8a4
 
 /* who knows what these are ... */
 SPECIAL         0xc6d8 - 0xc6e6 0xc876 - 0xc878
+SWIDTH2         0xc6d8 - 0xc6e6 0xc876 - 0xc878
 
 /* hiragana */
 SPECIAL         0xc6e7 - 0xc6fe 0xc740 - 0xc77a
+SWIDTH2         0xc6e7 - 0xc6fe 0xc740 - 0xc77a
 
 /* katakana */
 SPECIAL         0xc77b - 0xc77e 0xc7a1 - 0xc7f2
+SWIDTH2         0xc77b - 0xc77e 0xc7a1 - 0xc7f2
 
 /* ZIP code (in Japan) */
 SPECIAL         0xc8a5 - 0xc8cc
+SWIDTH2         0xc8a5 - 0xc8cc
 
 /* various Japanese symbols */
 SPECIAL         0xc8cd - 0xc8d3
+SWIDTH2         0xc8cd - 0xc8d3
 
 /* line drawing glyphs */
 SPECIAL         0xf9dd - 0xf9ff
+SWIDTH2         0xf9dd - 0xf9ff
 
 

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list