Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Jun 2001 23:10:02 -0700 (PDT)
From:      Peter Pentchev <roam@orbitel.bg>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/28007: added "force printing of non-print chars" flag to /bin/ls
Message-ID:  <200106110610.f5B6A2H79120@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/28007; it has been noted by GNATS.

From: Peter Pentchev <roam@orbitel.bg>
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106110610.f5B6A2H79120>