From owner-freebsd-hackers@FreeBSD.ORG Mon May 16 19:01:22 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E14A516A4CE for ; Mon, 16 May 2005 19:01:22 +0000 (GMT) Received: from enterprise4.noxa.de (enterprise.noxa.de [212.60.197.71]) by mx1.FreeBSD.org (Postfix) with ESMTP id DBC5443D82 for ; Mon, 16 May 2005 19:01:21 +0000 (GMT) (envelope-from arundel@h3c.de) Received: (qmail 9083 invoked from network); 16 May 2005 21:01:16 +0200 Received: from p508feebd.dip.t-dialin.net (HELO localhost.skatecity) (80.143.238.189) by enterprise.noxa.de with AES256-SHA encrypted SMTP; 16 May 2005 21:01:16 +0200 Received: from localhost.skatecity (nobody@localhost.skatecity [127.0.0.1]) by localhost.skatecity (8.13.3/8.13.3) with ESMTP id j4GJ1DXj020511 for ; Mon, 16 May 2005 21:01:13 +0200 (CEST) (envelope-from arundel@localhost.skatecity) Received: (from arundel@localhost) by localhost.skatecity (8.13.3/8.13.3/Submit) id j4GJ1Ddu020510 for freebsd-hackers@freebsd.org; Mon, 16 May 2005 21:01:13 +0200 (CEST) (envelope-from arundel) From: alexander Date: Mon, 16 May 2005 21:01:13 +0200 To: freebsd-hackers@freebsd.org Message-ID: <20050516190113.GA20359@skatecity> References: <20050516171143.GA19979@skatecity> <20050516.121716.41656814.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050516.121716.41656814.imp@bsdimp.com> Subject: Re: Console ASCII interpretation X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2005 19:01:23 -0000 On Mon May 16 05, Warner Losh wrote: > From: alexander > Subject: Console ASCII interpretation > Date: Mon, 16 May 2005 19:11:44 +0200 > > No. It means NUL. When writing with write(2), you are telling the > system to output 4 bytes. How different terminal emulation programs > react is up to them (since xterm and the console are implemented by > different sets of code). > > Warner Surely the implementation is up to the terminal itself, but what's the use of a STANDARD, if it isn't standarized? I found this little explanation: > 0 -- NUL -- Null character > The NUL character in the ASCII character set was originally ment to > be treated as a NOP, a character to be ignored. This would be useful > on paper tapes where additional information had to be added in between > existing information. However, some printing devices had the NUL implemented > as a wite space instead. Later on, the importance of the null character > increased significantly when it was defined as the string terminator in > the C programming language. It made it possible to define strings of > infinite length in programming languages. Until then most languages like > Pascal defined a string as a length indicator, followed by an array that > contained the characters. Since there already is an ascii code for the white space (SP = 20h) I don't quite understand why 00h is also interpreted as a white space. Because that makes two values for a white space, but not a single value for the NOP operator. If this behaviour of the console is due to historic reasons (old BSD or AT&T Unix) then there should be a way of changing the code. Cheers.