sharkdp / hexyl

A command-line hex viewer
Apache License 2.0
8.92k stars 227 forks source link

Add option to disable printing 0 bytes as ascii 0. #166

Closed martinlindhe closed 1 year ago

martinlindhe commented 1 year ago

Consider the following output

Capture

The right column present ASCII values of the hex column.

In the case of null bytes (value 0), they are printed as ascii 0 in the right column.

This is confusing to say the least. Consider for example the case of no color (it text after all. User will copy & paste it elsewhere):

Capture

As a comparison, here is xxd output, where they denote non-printable characters with a period instead:

Capture

I did not find any command line arguments to disable this.

I would like to request a mode of hexyl to print non-printable characters in a similar manner as xxd does it. Specifically I would like it to not insert printable ascii that does not belong in the ascii printout:

sharkdp commented 1 year ago

Good point, thank you. See discussion in #169