[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#17961: "od -c" producing numbers greater than 255 ?
From: |
Eric Blake |
Subject: |
bug#17961: "od -c" producing numbers greater than 255 ? |
Date: |
Mon, 07 Jul 2014 06:56:52 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
On 07/06/2014 06:27 PM, Sebastian Pipping wrote:
> Hello!
>
>
> Intersting, thanks for your reply. For "-c" the man page reads
>
> "printable character or backslash escape"
>
> I don't really see any mention of octal fallback in there :)
> Personally, I would expect (and prefer) \x?? output for any
> non-printable bytes from that description. My vote too add that or at
> least making the man page more precise about "-c", that would be cool.
Alas, we can't change the behavior; it is mandated by POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/od.html
-c
[XSI] [Option Start] Interpret bytes as characters specified by the
current setting of the LC_CTYPE category. Certain non-graphic characters
appear as C escapes: "NUL=\0", "BS=\b", "FF=\f", "NL=\n", "CR=\r",
"HT=\t"; others appear as 3-digit octal numbers. [Option End]
>
> I guess "od -t u1" is what I'll use in the meantime.
Yes, that is a reasonable action.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature