The program chd is a simple variation on the standard hexdump utility xxd(1) that dumps Unicode codepoints instead of raw bytes. This is particularly useful when dealing with UTF8-encoded files, where each character can occupy anywhere from one to four bytes.
Here's an example using a file containing the string "Îņţëřñåṭıőňⱥłȉʑḁŧīòń". The output from xxd:
And the output from chd:
(The character output in the right-hand column is spaced out to permit double-width characters to be displayed correctly.)
The source code also provides a simple example of using C's wide-character functions to portably handle Unicode I/O, without hard-coding the use of e.g. UTF-8.
The code in this distribution is made available under the MIT license. Share and Enjoy. Questions and comments should be directed to me at breadbox@muppetlabs.com.