bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: od -t a to warn for non-ASCII


From: Paul Eggert
Subject: Re: od -t a to warn for non-ASCII
Date: Wed, 01 Feb 2006 23:46:52 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Ed Avis <address@hidden> writes:

> I suggest that when 'od -t a' encounters the first high-bit-set
> character in the input it should print a warning

That sounds a bit strong.  All other things being equal I'd rather not
have behavior depend on POSIXLY_CORRECT.

> If you don't want to do that, please update the help text and info
> documentation to make it clear that the 'a' format maps high-bit-set
> characters onto the same output as ASCII

Good point, and thanks for the suggestion.  I installed this patch:

2006-02-01  Paul Eggert  <address@hidden>

        * doc/coreutils.texi (od invocation): Warn that -t a ignores the high
        order bit.  Documentation problem reported by Ed Avis.
        * src/od.c (usage): Likewise.

--- doc/coreutils.texi  31 Jan 2006 01:38:05 -0000      1.308
+++ doc/coreutils.texi  2 Feb 2006 07:39:48 -0000
@@ -1607,7 +1607,7 @@ to the output line generated by the type
 
 @table @samp
 @item a
-named character
+named character, ignoring high-order bit
 @item c
 @acronym{ASCII} character or backslash escape,
 @item d
@@ -1623,7 +1623,9 @@ hexadecimal
 @end table
 
 The type @code{a} outputs things like @samp{sp} for space, @samp{nl} for
-newline, and @samp{nul} for a null (zero) byte.  Type @code{c} outputs
+newline, and @samp{nul} for a null (zero) byte.  Only the least significant
+seven bits of each byte is used; the high-order bit is ignored.
+Type @code{c} outputs
 @samp{ }, @samp{\n}, and @code{\0}, respectively.
 
 @cindex type size
--- src/od.c    26 Nov 2005 07:29:48 -0000      1.168
+++ src/od.c    2 Feb 2006 07:39:48 -0000
@@ -337,7 +337,7 @@ All arguments to long options are mandat
       fputs (_("\
 \n\
 Traditional format specifications may be intermixed; they accumulate:\n\
-  -a   same as -t a,  select named characters\n\
+  -a   same as -t a,  select named characters, ignoring high-order bit\n\
   -b   same as -t o1, select octal bytes\n\
   -c   same as -t c,  select ASCII characters or backslash escapes\n\
   -d   same as -t u2, select unsigned decimal 2-byte units\n\
@@ -361,7 +361,7 @@ suffixes may be . for octal and b for mu
 \n\
 TYPE is made up of one or more of these specifications:\n\
 \n\
-  a          named character\n\
+  a          named character, ignoring high-order bit\n\
   c          ASCII character or backslash escape\n\
 "), stdout);
       fputs (_("\




reply via email to

[Prev in Thread] Current Thread [Next in Thread]