Nov-15-2017, 01:52 AM
the range of ASCII characters that are "printable" is 32 to 126, or 33 to 126, inclusive, depending on whether blank spaces are considered "printable" (they are at least safe to try to print). i am looking for a list of ranges of "printable" characters in unicode.
i am making some code to dump binary in a "readable" form, showing both the binary code in hexadecimal as well as the character if is a printable one else a '.' in place of each byte. i have created one for ASCII in C (and there are many others around, in pretty much every languge, i'm sure). i want to create one in python3 that includes support for UTF-8. that is, wherever it finds printable byte code combinations, it will output the character in the place where the character goes, depending on the dump style/format.
here is an example from the one i made (in 3 different widths) modeled after a common IBM mainframe dump style:
i am making some code to dump binary in a "readable" form, showing both the binary code in hexadecimal as well as the character if is a printable one else a '.' in place of each byte. i have created one for ASCII in C (and there are many others around, in pretty much every languge, i'm sure). i want to create one in python3 that includes support for UTF-8. that is, wherever it finds printable byte code combinations, it will output the character in the place where the character goes, depending on the dump style/format.
here is an example from the one i made (in 3 different widths) modeled after a common IBM mainframe dump style:
Output:lt1/forums /home/forums 6> which xd16
/usr/local/bin/xd16
lt1/forums /home/forums 7> xd16 < /usr/local/bin/xd16 | head -n40 | tail -n8
00000200 52e57464 04000000 281e0000 00000000 |R.td....(.......|
00000210 281e6000 00000000 281e6000 00000000 |(.`.....(.`.....|
00000220 d8010000 00000000 d8010000 00000000 |................|
00000230 01000000 00000000 2f6c6962 36342f6c |......../lib64/l|
00000240 642d6c69 6e75782d 7838362d 36342e73 |d-linux-x86-64.s|
00000250 6f2e3200 04000000 10000000 01000000 |o.2.............|
00000260 474e5500 00000000 02000000 06000000 |GNU.............|
00000270 0f000000 04000000 14000000 03000000 |................|
lt1/forums /home/forums 8>