hexdump -C outputs unreadable characters
In previous versions of OS X (10.4 and older), the terminal command "hexdump -C" only displayed ASCII characters in the right column (i.e. when using the "%_p" format). All the others (control characters etc, and anything above 127) were replaced by a dot. This is also how hexdump behaves in Linux.
Since Leopard however, the characters above 127 are also displayed somehow, and the terminal seems to convert them to 4-byte sequences. This makes that type of display useless. A file that looks like this in the old hexdump (best viewed in a monospaced font):
00000000 ff d8 ff e0 00 10 4a 46 49 46 00 01 01 01 00 60 |......JFIF.....`|
00000010 00 60 00 00 ff e1 00 6e 45 78 69 66 00 00 49 49 |.`.....nExif..II|
00000020 2a 00 08 00 00 00 01 00 69 87 04 00 01 00 00 00 |*.......i.......|
... looks like this in Leopard's hexdump:
00000000 ff d8 ff e0 00 10 4a 46 49 46 00 01 01 01 00 60 |<FF><D8><FF><E0>..J
FIF.....`|
00000010 00 60 00 00 ff e1 00 6e 45 78 69 66 00 00 49 49 |.`..<FF><E1>.nExif.
.II|
00000020 2a 00 08 00 00 00 01 00 69 87 04 00 01 00 00 00 |*.......i.......|
According to the manpage, the "%_p" format +"displays nonprinting characters as a single ``.''"+. So it seems Apple changed its definition of "nonprinting characters" in Leopard.
Is there any way to get the old behavior back?
Since Leopard however, the characters above 127 are also displayed somehow, and the terminal seems to convert them to 4-byte sequences. This makes that type of display useless. A file that looks like this in the old hexdump (best viewed in a monospaced font):
00000000 ff d8 ff e0 00 10 4a 46 49 46 00 01 01 01 00 60 |......JFIF.....`|
00000010 00 60 00 00 ff e1 00 6e 45 78 69 66 00 00 49 49 |.`.....nExif..II|
00000020 2a 00 08 00 00 00 01 00 69 87 04 00 01 00 00 00 |*.......i.......|
... looks like this in Leopard's hexdump:
00000000 ff d8 ff e0 00 10 4a 46 49 46 00 01 01 01 00 60 |<FF><D8><FF><E0>..J
FIF.....`|
00000010 00 60 00 00 ff e1 00 6e 45 78 69 66 00 00 49 49 |.`..<FF><E1>.nExif.
.II|
00000020 2a 00 08 00 00 00 01 00 69 87 04 00 01 00 00 00 |*.......i.......|
According to the manpage, the "%_p" format +"displays nonprinting characters as a single ``.''"+. So it seems Apple changed its definition of "nonprinting characters" in Leopard.
Is there any way to get the old behavior back?
MacBook Pro C2D 2.33, Mac OS X (10.5.3)