Displaying non-printable characters on a SPARC (or any other Unix system)

Richard A. O'Keefe ok at goanna.cs.rmit.oz.au
Thu May 9 14:11:54 AEST 1991


In article <6197 at mahendo.Jpl.Nasa.Gov>, robert at nereid.jpl.nasa.gov (Robert Angelino) writes:
> I'm writing some code that utilizes a primitive tty interface.
> I would like to display non-printable characters on my
> unix system.

If they _are_ "non-printable" characters, what do expect them to display AS?
If you are writing to a terminal, read your terminal manual.
If you are writing to the console, read your Sun manuals.
Tip:  SunOS 4.something supports 8-bit characters, and comes with
(at least some) fonts for the ISO 8859/1 character set.

> I've found out (through tracing) that the following clears the screen:
> 	print("\33[H\33[2J");	(this also happens to work on VMS)
> As you can see this is not what I would call intuitive.

What do you mean, it's not intuitive?  You send the home-clear sequence
to a terminal, what do you EXPECT it to do?  What's more, this is documented
at tedious length in The Fine Manuals.  Start with "man 1 suntools" and take
it from there.

> Has anyone out there discovered how I can go about doing this using
> simple printf statements??

But you haven't told us what you want to *DO*.  If you do not want ESC
to be recognised as part of a terminal control escape sequence, do you
want it to be displayed as a house, a boat, a picture of Queen Victoria,
or what?  The IBM PC assignments of pictures to codes is _not_ generally
available on other machines (I was enchanted to discover that the upper
128 characters on an Atari 520-ST included Hebrew letters).

It is not an exaggeration to describe SunOS as "copiously" documented.
There are several introductory manuals.  Go read them.

-- 
Bad things happen periodically, and they're going to happen to somebody.
Why not you?					-- John Allen Paulos.



More information about the Comp.lang.c mailing list