Python Forum
Thread Rating:
  • 2 Vote(s) - 1.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
unicode
#1
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:

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>
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
unicode - by Skaperen - Nov-15-2017, 01:52 AM
RE: unicode - by stranac - Nov-15-2017, 08:49 AM
RE: unicode - by sparkz_alot - Nov-15-2017, 03:04 PM
RE: unicode - by Skaperen - Nov-16-2017, 03:00 AM
RE: unicode - by sparkz_alot - Nov-16-2017, 02:43 PM
RE: unicode - by Skaperen - Nov-17-2017, 02:50 AM
RE: unicode - by sparkz_alot - Nov-17-2017, 02:05 PM
RE: unicode - by Skaperen - Nov-18-2017, 08:10 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020