Provide a program to help analyze files, supporting UTF-8.
This should work similar to "hexdump" but is not intended to match it feature for feature.
Provides three byte printing modes (with plans for a fourth):
1) hexidecimal (default)
2) octal
3) binary
4) digit (planned)
Provides first and last byte selection support.
A width option is available for specifying the number of bytes to be printed on screen such that each byte is essentially a data column.
With a width of 16, then there would be 16 data columns, each displaying one byte.
Although similar to "hexdump", the first column in bit_dump represents the specific row number.
A text option is provided to display the bytes as a character (similar to how "hexdump" uses "-C").
A placeholder option is available for showing a placeholder where placeholder spaces would otherwise be printed.
A placeholder is printed to ensure alignment.
For example, a printable UTF-8 character that is 3-bytes wide would only visibly take up 1 character of space.
To keep the alignment with text to bytes accurate and consistent, two additional placeholder spaces are appended following the UTF-8 characte.
If the bytes terminate before an entire column set of bytes are printed, then spaces or placeholders are printed until the full column may be printed when in "text" mode.
This will detect and report invalid UTF-8 codes.
Handling printing the characters (via the text option) can be tricky.
There is more work needed to catch all cases.
Some cases cannot be handled if the character is wider than the expected width (causing alignment printing issues).
I am still a bit inexperienced with the intricacies of UTF-8 and I expect there to be issues in this first pass.