From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE Date: Mon, 6 Apr 2020 18:55:30 +0200 Message-ID: <329AEABE-0D33-4324-B697-FBEA9340E6BB@acm.org> References: <805F9723-8298-4FD7-A47B-1E683721A5B0@acm.org> <835zegwn9y.fsf@gnu.org> <87blo46i1j.fsf@mail.parknet.co.jp> <835zecsnip.fsf@gnu.org> <5D4B264A-C43B-4CEE-91DE-760AEBE80671@acm.org> <83zhbor2ur.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="33392"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40407@debbugs.gnu.org, hirofumi@mail.parknet.co.jp To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 06 18:56:14 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jLV2k-0008a8-CQ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Apr 2020 18:56:14 +0200 Original-Received: from localhost ([::1]:35260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLV2j-00036Q-FN for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Apr 2020 12:56:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55095) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLV2a-00035y-Ud for bug-gnu-emacs@gnu.org; Mon, 06 Apr 2020 12:56:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jLV2Z-0007d5-Up for bug-gnu-emacs@gnu.org; Mon, 06 Apr 2020 12:56:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37606) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jLV2Z-0007cv-SH for bug-gnu-emacs@gnu.org; Mon, 06 Apr 2020 12:56:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jLV2Y-0000dJ-HS for bug-gnu-emacs@gnu.org; Mon, 06 Apr 2020 12:56:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Apr 2020 16:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 40407-submit@debbugs.gnu.org id=B40407.15861921442370 (code B ref 40407); Mon, 06 Apr 2020 16:56:02 +0000 Original-Received: (at 40407) by debbugs.gnu.org; 6 Apr 2020 16:55:44 +0000 Original-Received: from localhost ([127.0.0.1]:49152 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jLV2F-0000c8-FR for submit@debbugs.gnu.org; Mon, 06 Apr 2020 12:55:43 -0400 Original-Received: from mail208c50.megamailservers.eu ([91.136.10.218]:55040 helo=mail194c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jLV2C-0000bb-Sq for 40407@debbugs.gnu.org; Mon, 06 Apr 2020 12:55:42 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1586192134; bh=tS6xzKtTHnTVrXFZw9+AldNlVwiuIQB4vLC7LgwKWCc=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=anRE5aSEb/0mhaFYjETobvMWJnKD4C35d+TQL1myQ2b/20e2wqzsFYwNV3dNCYY9+ 5OiWfw/m9AnBtd6TBMz0LMBRyUl1QX0FlDonp8Czzlcg5UICe/r89XnF3ub2+UD/1p mef1rtnkAr9ya28lzWV+Y1PN9bXqD6/PG/+YrTTo= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.0.4] (c188-150-171-71.bredband.comhem.se [188.150.171.71]) (authenticated bits=0) by mail194c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 036GtV2K021646; Mon, 6 Apr 2020 16:55:33 +0000 In-Reply-To: <83zhbor2ur.fsf@gnu.org> X-Mailer: Apple Mail (2.3445.104.14) X-CTCH-RefID: str=0001.0A782F26.5E8B5EE0.00B7, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=KsozJleN c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=mDV3o1hIAAAA:8 a=r8PFI-Of08nG_EPcs_AA:9 a=CjuIK1q_8ugA:10 a=_FVE-zBwftR9WsbkzFJk:22 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:178092 Archived-At: 6 apr. 2020 kl. 18.33 skrev Eli Zaretskii : > I think it might be just some convenience thing: utf-7 and utf-8 have > something in common that made it convenient to treat them the same in > the internal routines. Or maybe it's just an accident. There is nothing common between utf-7 and utf-8 at all (apart from a = subset of ASCII being encoded in the same way, and the fact that both = encode the Unicode repertoire). > Why do you think the ASCII encoding contradicts the utf-16 > coding-type? Because :coding type is the first stage of decoding, or the last stage = of encoding. It reflects the low-level structure of the encoded data: = using utf-16 as :coding-type implies that utf-7 is encoded into 16-bit = parcels, but it's not -- the result of utf-7-imap encoding is a sequence = of ASCII bytes. (UTF-16 plays a part in an intermediary step for some = values before they are base64-encoded, but that's not visible in the = final byte stream.) > I don't think 'charset' is the right type for this encoding (any > reason why you've chosen it?), but I will let Handa-san comment. We could use 'raw-text' as well but that implies that any byte value = could be part of an utf-7[-imap] text, which is incorrect. In fact, utf-7-imap only uses codes 0x20-0x7e (utf-7 is allowed to use a = few C0 controls too, as mentioned). Arguably the heuristics of define-coding-system-internal are somewhat = inscrutable. There seems to be leaks between layers -- = ascii-compatible-p is an end-to-end property and cannot really be set = the way it is by that function. But since it is, fixing it afterwards = should be the correct way.