Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S265463AbUFSK2S (ORCPT ); Sat, 19 Jun 2004 06:28:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S265474AbUFSK2S (ORCPT ); Sat, 19 Jun 2004 06:28:18 -0400 Received: from disk.smurf.noris.de ([192.109.102.53]:42928 "EHLO server.smurf.noris.de") by vger.kernel.org with ESMTP id S265463AbUFSK2R (ORCPT ); Sat, 19 Jun 2004 06:28:17 -0400 To: linux-kernel@vger.kernel.org Path: not-for-mail From: Matthias Urlichs Newsgroups: smurf.list.linux.kernel Subject: Re: [PATCH] Stop printk printing non-printable chars Date: Sat, 19 Jun 2004 12:27:54 +0200 Organization: {M:U} IT Consulting Message-ID: References: <20040618205355.GA5286@newtoncomputing.co.uk> <20040618235223.GB5286@newtoncomputing.co.uk> <20040619041844.GG29808@alpha.home.local> NNTP-Posting-Host: kiste.smurf.noris.de Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: server.smurf.noris.de 1087640874 24275 192.109.102.35 (19 Jun 2004 10:27:54 GMT) X-Complaints-To: smurf@noris.de NNTP-Posting-Date: Sat, 19 Jun 2004 10:27:54 +0000 (UTC) User-Agent: Pan/0.14.2.91 (As She Crawled Across the Table) X-Face: '&-&kxR\8+Pqalw@VzN\p?]]eIYwRDxvrwEM Another way to do it would be to display "" like less, but '<' and '>' > are sensible because they're used to indicate the log level. Umm, they're not sensible. (You're mixing up word meanings.) Log levels are not a big problem, because the log level is always printed first. Usually. IMHO, the stuff should make sense to a human reader, and it should be possible to figure out quickly and unambiguously what the random bit pattern that inadvertently got printed actually *is*. That means: Escape anything <\x31 except \n. Escape \\. Escape anything with the 8th bit set. Use hex escapes \x## -- let's face it, they're as long as octal and easier to read these days. -- Matthias Urlichs - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/