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: Mon, 21 Feb 2005 10:19:53 +0900 (JST) Message-ID: <200502210119.KAA18613@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 1108950211 22826 80.91.229.2 (21 Feb 2005 01:43:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 21 Feb 2005 01:43:31 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 21 02:43:30 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D32bX-0005gP-SC for ged-emacs-devel@m.gmane.org; Mon, 21 Feb 2005 02:43:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D32sO-00066T-F1 for ged-emacs-devel@m.gmane.org; Sun, 20 Feb 2005 21:00:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D32lf-0004ic-LM for emacs-devel@gnu.org; Sun, 20 Feb 2005 20:53:47 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D32lP-0004Ut-Az for emacs-devel@gnu.org; Sun, 20 Feb 2005 20:53:39 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D32lG-0004OY-Ms for emacs-devel@gnu.org; Sun, 20 Feb 2005 20:53:22 -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 1D32Ey-0006wj-33; Sun, 20 Feb 2005 20:20:00 -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 j1L1JtXD023280; Mon, 21 Feb 2005 10:19:55 +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 j1L1JsPN026628; Mon, 21 Feb 2005 10:19:54 +0900 Original-Received: (from handa@localhost) by etlken.m17n.org (8.8.8+Sun/3.7W-2001040620) id KAA18613; Mon, 21 Feb 2005 10:19:53 +0900 (JST) Original-To: rms@gnu.org In-reply-to: (message from Richard Stallman on Sat, 19 Feb 2005 15:55:45 -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:33659 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:33659 In article , Richard Stallman writes: > 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 what would it mean, in the other cases? > I see I misread the message the first time--I didn't see the "not". > Now that I see it, I think maybe I agree. > If you have a multibyte string that makes sense to decode, and you > want to decode it, you could call string-as-unibyte first. That would > be a way of overriding the error-check. It would not be hard to do, > and it would prevent people from falling into problems that are > mysterious because they don't know that the program decodes multibyte > strings. The source of the current problem is not that the code was going to decode a multibyte string, but the code generated an unexpected multibyte string (because of the mysterious unibyte->multibyte automatic conversion). As it has been a valid operation to decode an ascii and eight-bit-* only multibyte string, I believe signalling an error on it causes lots of problems. On the other hand, signalling an error only if the string contains a non-ASCII non-eight-bit-* character will be good. As you wrote, the slowdown by checking it in advance will be acceptable in the case of using decode-coding-string. --- Ken'ichi HANDA handa@m17n.org