[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: What are the 94 printable characters from the 128 characters of ASCII table?



Paul E Condon wrote:
> but 2 are non printing: 0x20 and 0x7F
> I leave the last step as an exercise for the reader. ;-)

I hate to make this thread longer...  Sigh.

Whether something is printable or not was easier to see in the old
days when printers had dot matrix or daisy wheels or selectric balls
or other such loud and visible print heads.  If you emitted a
printable character the head moved forward.  If you emited a
non-printable character the head did not move forward.

Using that definition space is definitely a printable character since
it moves the print head forward.  We are all agreed that it is
invisible.  But being invisible is not part of the definition of
whether it is printable or not.

DEL 0x7f is a control character.  It is not a printable character.
And its history is interesting.

You can see this for yourself.

  $ printf "a\x20b\n" | od -tx1
  0000000 61 20 62 0a

  $ printf "a\x20b\n"
  a b

Space was printed in the above.  Space is a printable, if invisible,
character.

  $ printf "a\x7fb\n" | od -tx1
  0000000 61 7f 62 0a

  $ printf "a\x7fb\n"
  ab

DEL was not printed, did not move the head forward, a was followed
immediately by b, DEL is not a printable character.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: