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

From: Jesper Juhl
Date: Fri Jun 18 2004 - 17:57:48 EST



On Fri, 18 Jun 2004, Linus Torvalds wrote:
>
>
> On Fri, 18 Jun 2004 matthew-lkml@xxxxxxxxxxxxxxxxxxxxx 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@xxxxxx>


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/