From owner-freebsd-hackers Thu Jul 25 20:57:27 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id UAA24378 for hackers-outgoing; Thu, 25 Jul 1996 20:57:27 -0700 (PDT) Received: from sovcom.kiae.su (sovcom.kiae.su [193.125.152.1]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id UAA24372 for ; Thu, 25 Jul 1996 20:57:21 -0700 (PDT) Received: by sovcom.kiae.su id AA24973 (5.65.kiae-1 ); Fri, 26 Jul 1996 06:51:06 +0300 Received: by sovcom.KIAE.su (UUMAIL/2.0); Fri, 26 Jul 96 06:51:06 +0300 Received: (from ache@localhost) by nagual.ru (8.7.5/8.7.3) id HAA01313; Fri, 26 Jul 1996 07:46:26 +0400 (MSD) Message-Id: <199607260346.HAA01313@nagual.ru> Subject: Re: patch for the 'sgetrune' of EUC encoding To: mihoko@pa.yokogawa.co.jp (=?ISO-2022-JP?B?GyRCRURDZkh+SmY7UhsoQg==?=) Date: Fri, 26 Jul 1996 07:46:26 +0400 (MSD) Cc: freebsd-hackers@freebsd.org In-Reply-To: <199607251120.UAA00307@sapphire.pa.yokogawa.co.jp> from "[?ISO-2022-JP?]" at "Jul 25, 96 08:20:17 pm" From: =?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?= (Andrey A. Chernov) Organization: self X-Class: Fast X-Mailer: ELM [version 2.4ME+ PL22 (25)] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > That is, The library function 'mblen(3)' doesn't return the error > when the second byte is not set MSB. > I make the following patch for this problem. ... > + /* '0x80-0x9f' are control codes */ > + if ((c = (unsigned char)*string++) < 0xa0) { I dislike this hardcoded assumption, because it makes sgetrune very charset-depended without proper configuration knobs. I.e. if it plans to sense control codes, it must be iscntrl() instead. Could you change this thing? -- Andrey A. Chernov http://www.nagual.ru/~ache/