Re: [PATCH] Stop printk printing non-printable chars

Jesper Juhl
2004-06-18T22:49:18Z

On Fri, 18 Jun 2004, Linus Torvalds wrote:
>
>
> On Fri, 18 Jun 2004 matthew-lkml@newtoncomputing.co.uk wrote:
> >
> > The main problem seems to be in ACPI, but I don't see any reason for
> > printk to even consider printing _any_ non-printable characters at all.
> > It makes all characters out of the range 32..126 (except for newline)
> > print as a '?'.
>
> How about emitting them as \xxx, so that you see what they are. And using
> a case-statement to make it easy and clear when to do exceptions (I think
> we should accept \t too, no?).
>

Would there be any reason not to allow all the standard C escape sequences
- true, they are hardly used atm (I see a few \f uses with grep, but not
much else), but it's not unthinkable they could be useful somewhere in
some cases (I'm thinking \f could be useful for console on line-printer
for example, \a could be useful for critical errors on boxes without a
monitor - or maybe that's all too far fetched)...

\a alert (bell)
\b backspace
\f formfeed
\n newline
\r carriage return
\t horizontal tab
\v vertical tab
\\ backslash
\? question mark
\' single quote
\" double quote

(the last few are in the 32..126 range, just listing for completeness)...
none of them should cause trouble on output, so little reason to exclude
them if someone find a use for them at some point - or am I not making
sense?

--
Jesper Juhl <juhl-lkml@dif.dk>