From owner-freebsd-standards Thu Jun 13 6:15:23 2002 Delivered-To: freebsd-standards@freebsd.org Received: from treetop.robbins.dropbear.id.au (152.d.007.mel.iprimus.net.au [210.50.83.152]) by hub.freebsd.org (Postfix) with ESMTP id 0DDA837B40F for ; Thu, 13 Jun 2002 06:15:19 -0700 (PDT) Received: from treetop.robbins.dropbear.id.au (localhost [127.0.0.1]) by treetop.robbins.dropbear.id.au (8.12.2/8.12.2) with ESMTP id g5DDCbBF069720 for ; Thu, 13 Jun 2002 23:12:37 +1000 (EST) (envelope-from tim@treetop.robbins.dropbear.id.au) Received: (from tim@localhost) by treetop.robbins.dropbear.id.au (8.12.2/8.12.2/Submit) id g5DDCb9J069719 for standards@FreeBSD.ORG; Thu, 13 Jun 2002 23:12:37 +1000 (EST) Date: Thu, 13 Jun 2002 23:12:36 +1000 From: "Tim J. Robbins" To: standards@FreeBSD.ORG Subject: Re: cvs commit: src/usr.bin/wc wc.1 wc.c Message-ID: <20020613231236.A69696@treetop.robbins.dropbear.id.au> References: <200206131248.g5DCmol89972@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200206131248.g5DCmol89972@freefall.freebsd.org>; from tjr@FreeBSD.ORG on Thu, Jun 13, 2002 at 05:48:50AM -0700 Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Jun 13, 2002 at 05:48:50AM -0700, Tim J. Robbins wrote: > tjr 2002/06/13 05:48:50 PDT > > Modified files: > usr.bin/wc wc.1 wc.c > Log: > Add the -m option, which counts characters (as opposed to -c, which > counts bytes). In locales that don't have multibyte characters, -m > is effectively an alias for -c. > > This brings wc(1) up to P1003.1-2001 conformance. I had planned to wait until the wide character stdio support was implemented, but I don't think wc(1) would have benefited at all from it. I'm fairly confident that this approach is faster than a fgetwc()-based loop in both single- and multi- byte encodings. There aren't many other utilities that are this simple, so most of the work in supporting multibyte locales will have to wait until wide char stdio is implemented. I feel that supporting wide characters properly is very important as encodings like UTF-8 are becoming quite popular. Tim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message