From owner-freebsd-bugs Sun Jun 10 23:10: 6 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id B8FAF37B408 for ; Sun, 10 Jun 2001 23:10:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.3/8.11.3) id f5B6A2H79120; Sun, 10 Jun 2001 23:10:02 -0700 (PDT) (envelope-from gnats) Date: Sun, 10 Jun 2001 23:10:02 -0700 (PDT) Message-Id: <200106110610.f5B6A2H79120@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Peter Pentchev Subject: Re: bin/28007: added "force printing of non-print chars" flag to /bin/ls Reply-To: Peter Pentchev Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/28007; it has been noted by GNATS. From: Peter Pentchev To: Jordan.DeLong@cx420564-b.tucson1.az.home.com Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: bin/28007: added "force printing of non-print chars" flag to /bin/ls Date: Mon, 11 Jun 2001 09:06:41 +0300 On Sun, Jun 10, 2001 at 12:56:42AM -0700, Jordan.DeLong@cx420564-b.tucson1.az.home.com wrote: > > >Number: 28007 > >Category: bin > >Synopsis: added "force printing of non-print chars" flag to /bin/ls > >Originator: Jordan DeLong > >Release: FreeBSD 4.3-RELEASE i386 > >Organization: > None > >Environment: > System: FreeBSD cx420564-b 4.3-RELEASE FreeBSD 4.3-RELEASE #0: Tue Apr 24 08:33:58 GMT 2001 fracture@cx420564-b:/usr/src/sys/compile/HOBOIV i386 > > >Description: > when the output of /bin/ls is not to a terminal, it defaults to > printing non-printable characters directly. However, when output > is to a tty there is no way to make it output non-printable chars. > > /bin/ls uses isprint() to determine if a character is printable; > this includes high-bit ascii characters that really are printable > in some settings, and also includes filenames that have kanji in > them. So forcing the raw printing of these characters can be > desirable even on a tty, particularly for those who use languages > other than English that make use of characters that don't fall in > isprint(). Correct me if I'm wrong, but doesn't isprint() conform to locale settigs? I don't know if this works with multibyte characters, but for 8-bit locales ls(1) certainly does the right thing, due to a setlocale(LC_ALL, "") call at the very start. > I've added a -w flag to /bin/ls that is used to force raw output > of nonprintable characters when the output is a tty. Other than the above argumet, yes, such a flag could be useful. G'luck, Peter -- This sentence no verb. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message