From owner-cvs-src@FreeBSD.ORG Thu Nov 6 03:03:08 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AC5B616A4CE; Thu, 6 Nov 2003 03:03:08 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E7B6C43F85; Thu, 6 Nov 2003 03:03:07 -0800 (PST) (envelope-from davidxu@freebsd.org) Received: from freebsd.org (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id hA6B2xFY008689; Thu, 6 Nov 2003 03:03:00 -0800 (PST) (envelope-from davidxu@freebsd.org) Message-ID: <3FAA2CFE.3040502@freebsd.org> Date: Thu, 06 Nov 2003 19:14:06 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.5) Gecko/20031025 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tim Robbins References: <200311052252.hA5Mqpkd052553@repoman.freebsd.org> <20031106094214.GA5455@wombat.robbins.dropbear.id.au> <3FAA1B7D.3070307@viatech.com.cn> <20031106101939.GA5735@wombat.robbins.dropbear.id.au> In-Reply-To: <20031106101939.GA5735@wombat.robbins.dropbear.id.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: David Xu cc: src-committers@freebsd.org cc: cvs-all@freebsd.org cc: cvs-src@freebsd.org Subject: Re: cvs commit: src/usr.bin/mklocale yacc.y src/lib/libc/locale Makefile.inc gb2312.c setrunelocale.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2003 11:03:09 -0000 Tim Robbins wrote: >On Thu, Nov 06, 2003 at 05:59:25PM +0800, David Xu wrote: > > > >>Tim Robbins wrote: >> >> >> >>>On Wed, Nov 05, 2003 at 02:52:51PM -0800, David Xu wrote: >>> >>> >>> >>> >>> >>>>davidxu 2003/11/05 14:52:51 PST >>>> >>>>FreeBSD src repository >>>> >>>>Modified files: >>>> usr.bin/mklocale yacc.y >>>> lib/libc/locale Makefile.inc setrunelocale.c >>>>Added files: >>>> lib/libc/locale gb2312.c >>>>Log: >>>>Add gb2312 encoding. >>>> >>>> >>>> >>>> >>>This looks like EUC. Is there any chance you could use the EUC encoding >>>code instead of adding another one? Also, out of curiosity, how is it >>>different from zh_CN.eucCN? >>> >>> >>>Tim >>> >>> >>> >>> >>> >>I hear euc does not check error sequence which is not encoded by GB2312 >>, right ? >>Despite that, most program ported from Linux only support GB2312 or GBK >>, but not >>euc, I always has trouble with euc when running some Linux programs. >> >> > >Right. Apple solved this in Darwin by calling isrune() on the wide character >before returning it from mbrtowc(). I'm considering doing the same thing >in FreeBSD, but I'm not sure whether it would break any applications >that relied on the old behaviour. If I did that, would it be possible >to use the EUC encoding code? > > > If there is encoding same as GB2312, I won't commit GB2312, but zh_CN.GB2312 is still needed, it can be a symbol link to euc directory, libc supports loading zh_CN.GB2312, this becauses most programs are hard coded to use zh_CN.GB2312 or zh_CN.GBK, they simply don't understand euc, when they can not find zh_CN.GB2312 or zh_CN.GBK in enviroment variables, they simply reset to "C" locale, this causes lots of trouble among Chinese FreeBSD users, it is really a shame that so many years FreeBSD did not have GB2312 locale name. :-( Go ahead if you can fix this problem, but please take a look at my in share/mklocal/zh_CN.GB2312.src, and possible merge some new stuffs back to euc file. >Tim > > >