From ybbkaz@yahoo.co.jp  Fri Apr  8 22:26:56 2005
Return-Path: <ybbkaz@yahoo.co.jp>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 1C1A816A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  8 Apr 2005 22:26:56 +0000 (GMT)
Received: from ybbsmtp16.mail.mci.yahoo.co.jp (ybbsmtp16.mail.mci.yahoo.co.jp [210.80.241.190])
	by mx1.FreeBSD.org (Postfix) with SMTP id 2353343D2D
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  8 Apr 2005 22:26:55 +0000 (GMT)
	(envelope-from ybbkaz@yahoo.co.jp)
Received: from unknown (HELO eyes.violasystem.net) (219.195.104.17 with poptime)
  by ybbsmtp16.mail.mci.yahoo.co.jp with SMTP; 8 Apr 2005 22:26:53 -0000
Received: from eyes.violasystem.net (eyes.violasystem.net [127.0.0.1])
	by eyes.violasystem.net (8.13.3/8.13.3) with ESMTP id j38MQkDG012973
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 9 Apr 2005 07:26:47 +0900 (JST)
	(envelope-from ybbkaz@yahoo.co.jp)
Received: (from kazuaki@localhost)
	by eyes.violasystem.net (8.13.3/8.13.3/Submit) id j38MQklp012972;
	Sat, 9 Apr 2005 07:26:46 +0900 (JST)
	(envelope-from ybbkaz@yahoo.co.jp)
Message-Id: <200504082226.j38MQklp012972@eyes.violasystem.net>
Date: Sat, 9 Apr 2005 07:26:46 +0900 (JST)
From: Kazuaki Oda <ybbkaz@yahoo.co.jp>
Reply-To: Kazuaki Oda <ybbkaz@yahoo.co.jp>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] wcwidth(3) returns wrong value about characters in ja_JP.eucJP locale
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         79701
>Category:       conf
>Synopsis:       [PATCH] wcwidth(3) returns wrong value about characters in ja_JP.eucJP locale
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ume
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 08 22:30:24 GMT 2005
>Closed-Date:    Sun Feb 19 07:19:32 GMT 2006
>Last-Modified:  Sun Feb 19 07:19:32 GMT 2006
>Originator:     Kazuaki Oda <ybbkaz@yahoo.co.jp>
>Release:        FreeBSD 5.4-RC1 i386
>Organization:
>Environment:
System: FreeBSD eyes.violasystem.net 5.4-RC1 FreeBSD 5.4-RC1 #0: Sun Apr 3 22:32:16 JST 2005 kazuaki@eyes.violasystem.net:/usr/obj/usr/src/sys/EYES i386


>Description:
	wcwidth(3) should return 2 about characters in JISX0208 codeset.
	But it returns 1.
>How-To-Repeat:

>Fix:

	Apply attached patch.

--- ja_JP.eucJP.src.patch begins here ---
--- share/mklocale/ja_JP.eucJP.src	Fri Nov 30 14:05:53 2001
+++ share/mklocale/ja_JP.eucJP.src.new	Sat Apr  9 03:44:43 2005
@@ -37,6 +37,8 @@
 TODIGIT       	< 'A' - 'F' : 10 >
 TODIGIT       	< 'a' - 'f' : 10 >
 
+SWIDTH1		0x20 - 0x7e
+
 /*
  * Code Set 2
  */
@@ -46,9 +48,12 @@
 PHONOGRAM	0xa1bc
 SPECIAL     	0xa1a2 - 0xa1fe
 PUNCT		0xa1a2 - 0xa1f8		/* A few too many in here... */
+SWIDTH2		0xa1a1 - 0xa1fe
 
 SPECIAL		0xa2a1 - 0xa2ae 0xa2ba - 0xa2c1 0xa2ca - 0xa2d0 0xa2dc - 0xa2ea
 SPECIAL		0xa2f2 - 0xa2f9 0xa2fe
+SWIDTH2		0xa2a1 - 0xa2ae 0xa2ba - 0xa2c1 0xa2ca - 0xa2d0 0xa2dc - 0xa2ea
+SWIDTH2		0xa2f2 - 0xa2f9 0xa2fe
 
 /* ?DIGIT           0xa3b0 - 0xa3b9 */
 UPPER		0xa3c1 - 0xa3da				/* Romaji */
@@ -64,8 +69,14 @@
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dda1 - 0xddfe
+SWIDTH2		0xdea1 - 0xdefe
+SWIDTH2		0xdfa1 - 0xdffe
+SWIDTH2		0xe0a1 - 0xe0fe
+SWIDTH2		0xe1a1 - 0xe1fe
+SWIDTH2		0xe2a1 - 0xe2fe
+SWIDTH2		0xe3a1 - 0xe3fe
+SWIDTH2		0xe4a1 - 0xe4fe
+SWIDTH2		0xe5a1 - 0xe5fe
+SWIDTH2		0xe6a1 - 0xe6fe
+SWIDTH2		0xe7a1 - 0xe7fe
+SWIDTH2		0xe8a1 - 0xe8fe
+SWIDTH2		0xe9a1 - 0xe9fe
+SWIDTH2		0xeaa1 - 0xeafe
+SWIDTH2		0xeba1 - 0xebfe
+SWIDTH2		0xeca1 - 0xecfe
+SWIDTH2		0xeda1 - 0xedfe
+SWIDTH2		0xeea1 - 0xeefe
+SWIDTH2		0xefa1 - 0xeffe
+SWIDTH2		0xf0a1 - 0xf0fe
+SWIDTH2		0xf1a1 - 0xf1fe
+SWIDTH2		0xf2a1 - 0xf2fe
+SWIDTH2		0xf3a1 - 0xf3fe
+SWIDTH2		0xf4a1 - 0xf4a4
 
 /*
  * This is for Code Set 3, half-width kana
@@ -159,3 +244,4 @@
 SPECIAL		0xa1 - 0xdf
 PHONOGRAM	0xa1 - 0xdf
 CONTROL		0x84 - 0x97 0x9b - 0x9f 0xe0 - 0xfe
+SWIDTH1		0xa1 - 0xdf
--- ja_JP.eucJP.src.patch ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: ume 
State-Changed-When: Sun Feb 12 16:15:16 UTC 2006 
State-Changed-Why:  
Thank you for the report and the fix.  It fixes the problem 
reported by many Japanese people that tcsh doesn't work 
correctly on FreeBSD 6.0 and later. 
I've just committed it into HEAD, and I'll MFC it soon. 


Responsible-Changed-From-To: freebsd-bugs->ume 
Responsible-Changed-By: ume 
Responsible-Changed-When: Sun Feb 12 16:15:16 UTC 2006 
Responsible-Changed-Why:  
I've committed it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=79701 
State-Changed-From-To: patched->closed 
State-Changed-By: ume 
State-Changed-When: Sun Feb 19 07:18:09 UTC 2006 
State-Changed-Why:  
I've MFC'ed it into RELENG_6 and RELENG_5.  Thanks again! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=79701 
>Unformatted:
