home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * macfilter - Convert non-ascii characters to octal excapes for the
- * LaserWriter printer. This usually only happens with Postscript
- * files generated by the Macintosh, it isn't supposed to do that
- * but sometimes it does. This little guy makes it all better
- * again.
- * Author: Brian Powell, brian@ut-sally
- */
-
- #include <stdio.h>
- #include <ctype.h>
-
- main()
- {
- register char c;
-
- while ((c = getchar()) != EOF) {
- if (!isascii(c))
- printf("\\%03o", ((int)c) & 0377);
- else
- putchar(c);
- }
- exit (0); /* set explicit exit code for the spooler */
- }
-