hexdump `_u` conversion outputs ambiguous string.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bsdmainutils (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Output hex codes for 12 and 255, then convert it to binary, and dump these using hexdump's '_u' conversion string, (_u means output US ASCII characters):
printf '%.2x\n' 12 255 | xxd -r -p | hexdump -v -e '/1 " _%_u\_\n"'
Output:
_ff_
_ff_
Expected result would be two different strings, (maybe "FF" for the first one?), or failing that, to document this ambiguity in 'man hexdump'.
Note that some format strings like '_p' are quite non-specific, and output all non-printing chars as a '.', and that's to be expected. But for '_u' this is not expected, and the above is the only instance of ambiguous output, as shown by:
printf '%.2x\n' {0..255} | xxd -r -p | \
hexdump -v -e '/1 " _%_u\_\n"' | \
sort | uniq -c | sort -nr | head -2
Output (i.e. the only duplicate is 'ff'):
2 _ff_
1 _Z_
Hope this helps...