From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: decode-coding-string gone awry? Date: Fri, 18 Feb 2005 17:30:20 +0900 (JST) Message-ID: <200502180830.RAA12009@etlken.m17n.org> References: <200502140150.KAA29610@etlken.m17n.org> <200502171208.VAA09592@etlken.m17n.org> <878y5n9vh9.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1108716215 27517 80.91.229.2 (18 Feb 2005 08:43:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 18 Feb 2005 08:43:35 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 18 09:43:34 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D23jR-0001sY-QD for ged-emacs-devel@m.gmane.org; Fri, 18 Feb 2005 09:43:26 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D23zk-000754-I9 for ged-emacs-devel@m.gmane.org; Fri, 18 Feb 2005 04:00:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D23t8-0004pa-VW for emacs-devel@gnu.org; Fri, 18 Feb 2005 03:53:27 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D23t5-0004ok-EL for emacs-devel@gnu.org; Fri, 18 Feb 2005 03:53:25 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D23rg-0004Ax-Nf for emacs-devel@gnu.org; Fri, 18 Feb 2005 03:51:56 -0500 Original-Received: from [192.47.44.130] (helo=tsukuba.m17n.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1D23Wq-0005rg-Gp; Fri, 18 Feb 2005 03:30:25 -0500 Original-Received: from nfs.m17n.org (nfs.m17n.org [192.47.44.7]) by tsukuba.m17n.org (8.12.3/8.12.3/Debian-7.1) with ESMTP id j1I8ULXD007162; Fri, 18 Feb 2005 17:30:22 +0900 Original-Received: from etlken.m17n.org (etlken.m17n.org [192.47.44.125]) by nfs.m17n.org (8.12.3/8.12.3/Debian-7.1) with ESMTP id j1I8UKPN014476; Fri, 18 Feb 2005 17:30:20 +0900 Original-Received: (from handa@localhost) by etlken.m17n.org (8.8.8+Sun/3.7W-2001040620) id RAA12009; Fri, 18 Feb 2005 17:30:20 +0900 (JST) Original-To: Stefan Monnier In-reply-to: <878y5n9vh9.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Thu, 17 Feb 2005 08:20:36 -0500) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.3.50 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: main.gmane.org gmane.emacs.devel:33601 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:33601 In article <878y5n9vh9.fsf-monnier+emacs@gnu.org>, Stefan Monnier writes: >> Even if size_byte == size, it may contain eight-bit-graphic >> characters, and decoding such a string is a valid operation. >> And even if size_byte > size, it may contain only ASCII, >> eight-bit-graphic, and eight-bit-control charactes. It's >> also a valid operation to decode it. > I think it should not be considered valid to decode a multibyte string, > whether the string happens to only contains ASCII (or ASCII+eight-bit-*) > or not. But, we allow decode-coding-region in a multibyte buffer. Then, it's strange not to allow something like this: (decode-coding-string (buffer-substring FROM TO) CODING) >> It's not a trivial work to change the current code (in coding.c) to signal >> an error safely while doing a code conversion. > If by "safely" you mean "which will not break currently working code", > I agree. If by "safely" you mean "which will not break properly written > code", I disagree. I mean by "safely" to signal an error only at a safe place, i.e., the place where we can do a global exit. For instance, we can't signal an error in decode_coding_iso2022 because it may be modifying buffer contents directly. By the way, what do you mean by "properly written code"? --- Ken'ichi HANDA handa@m17n.org