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 17:56:27 +0200 Message-ID: <5D4B264A-C43B-4CEE-91DE-760AEBE80671@acm.org> References: <805F9723-8298-4FD7-A47B-1E683721A5B0@acm.org> <835zegwn9y.fsf@gnu.org> <87blo46i1j.fsf@mail.parknet.co.jp> <835zecsnip.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_230E54E8-1BE2-40F3-9FB2-C2A479E2BA88" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="29868"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40407@debbugs.gnu.org, OGAWA Hirofumi To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 06 17:57:19 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 1jLU7h-0007bU-QY for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Apr 2020 17:57:17 +0200 Original-Received: from localhost ([::1]:34310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLU7f-0003Tq-TL for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Apr 2020 11:57:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46992) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLU7U-0003R3-ET for bug-gnu-emacs@gnu.org; Mon, 06 Apr 2020 11:57:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jLU7T-00076C-FH for bug-gnu-emacs@gnu.org; Mon, 06 Apr 2020 11:57:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37544) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jLU7T-000763-1H for bug-gnu-emacs@gnu.org; Mon, 06 Apr 2020 11:57:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jLU7T-0005qR-1S for bug-gnu-emacs@gnu.org; Mon, 06 Apr 2020 11:57: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 15:57: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.158618860822401 (code B ref 40407); Mon, 06 Apr 2020 15:57:02 +0000 Original-Received: (at 40407) by debbugs.gnu.org; 6 Apr 2020 15:56:48 +0000 Original-Received: from localhost ([127.0.0.1]:49089 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jLU7D-0005pD-Ni for submit@debbugs.gnu.org; Mon, 06 Apr 2020 11:56:48 -0400 Original-Received: from mail1433c50.megamailservers.eu ([91.136.14.33]:55012 helo=mail263c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jLU78-0005oN-So for 40407@debbugs.gnu.org; Mon, 06 Apr 2020 11:56:44 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1586188592; bh=YsiqJOgbtsvkafpr5nbTxMfpeXNm0dgsWcU7IkO9NKM=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=bFQaAYyE9Zvh8a/I/BuiEZ3za4TnJTVT/w3gIxVHyVQXw8IFLHD9P1GOkRXnhMgJc 7Cdj9ZMV7QMjf8xjonqfkrfJpQbTYWeDV4AuXYDvr7dOEyqFvPRXrIjgq5+87RztQY +0dNXupK9nIRCihO6IFxENXIfzSTBqKoUv5uDHXM= 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 mail263c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 036FuSdr016171; Mon, 6 Apr 2020 15:56:30 +0000 In-Reply-To: <835zecsnip.fsf@gnu.org> X-Mailer: Apple Mail (2.3445.104.14) X-CTCH-RefID: str=0001.0A782F24.5E8B5105.0024, 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=e6d4tph/ c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=M51BFTxLslgA:10 a=mDV3o1hIAAAA:8 a=3pAwX9jsd0u1J1Px0qAA:9 a=CjuIK1q_8ugA:10 a=39F48Vm0bRl1VN-4Pd4A:9 a=De_Ol2h6w80A:10 a=tclcd6dtLQvEqt9_mmAA:9 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:178089 Archived-At: --Apple-Mail=_230E54E8-1BE2-40F3-9FB2-C2A479E2BA88 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 6 apr. 2020 kl. 16.21 skrev Eli Zaretskii : > Kenichi, why was coding-type of UTF-7 systems set to 'utf-8'? > Wouldn't it be better to set it to 'utf-16'? Or is there some > subtlety here that we should be aware of? Do you have any comments on > the patch below? There is no reason why utf-7[-imap] should have utf-8 as coding-type, is = there? utf-16 is definitely wrong (utf-7* are encoded in ASCII). What = about the patch below instead? By the way, there appears to be another, unrelated bug in utf-7-imap: = According to RFC 2060, all C0 controls are base64-encoded, but in Emacs = some of them are passed through unchanged (CR, LF and TAB). This is = permitted by plain UTF-7 (RFC 1642) but not in the IMAP variant. --Apple-Mail=_230E54E8-1BE2-40F3-9FB2-C2A479E2BA88 Content-Disposition: attachment; filename=utf-7.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="utf-7.diff" Content-Transfer-Encoding: quoted-printable diff=20--git=20a/lisp/international/mule-conf.el=20= b/lisp/international/mule-conf.el=0Aindex=20e6e6135243..c5cfbaeb87=20= 100644=0A---=20a/lisp/international/mule-conf.el=0A+++=20= b/lisp/international/mule-conf.el=0A@@=20-1511,20=20+1511,25=20@@=20= 'iso-safe=0A=20=0A=20(define-coding-system=20'utf-7=0A=20=20=20"UTF-7=20= encoding=20of=20Unicode=20(RFC=202152)."=0A-=20=20:coding-type=20'utf-8=0A= +=20=20:coding-type=20'charset=0A+=20=20:charset-list=20'(ascii)=0A=20=20= =20:mnemonic=20?U=0A=20=20=20:mime-charset=20'utf-7=0A-=20=20= :charset-list=20'(unicode)=0A=20=20=20:pre-write-conversion=20= 'utf-7-pre-write-conversion=0A=20=20=20:post-read-conversion=20= 'utf-7-post-read-conversion)=0A+;;=20Having=20`ascii'=20in=20= :charset-list=20automatically=20sets=20:ascii-compatible-p,=0A+;;=20but=20= UTF-7=20is=20not=20ASCII=20compatible;=20disable.=0A+(coding-system-put=20= 'utf-7=20:ascii-compatible-p=20nil)=0A=20=0A=20(define-coding-system=20= 'utf-7-imap=0A=20=20=20"UTF-7=20encoding=20of=20Unicode,=20IMAP=20= version=20(RFC=202060)"=0A-=20=20:coding-type=20'utf-8=0A+=20=20= :coding-type=20'charset=0A+=20=20:charset-list=20'(ascii)=0A=20=20=20= :mnemonic=20?u=0A-=20=20:charset-list=20'(unicode)=0A=20=20=20= :pre-write-conversion=20'utf-7-imap-pre-write-conversion=0A=20=20=20= :post-read-conversion=20'utf-7-imap-post-read-conversion)=0A+;;=20See=20= comment=20for=20utf-7=20above.=0A+(coding-system-put=20'utf-7-imap=20= :ascii-compatible-p=20nil)=0A=20=0A=20;;=20Use=20us-ascii=20for=20= terminal=20output=20if=20some=20other=20coding=20system=20is=20not=0A=20= ;;=20specified=20explicitly.=0Adiff=20--git=20= a/test/lisp/international/mule-tests.el=20= b/test/lisp/international/mule-tests.el=0Aindex=2091e3c2279f..b5fbb4ab8e=20= 100644=0A---=20a/test/lisp/international/mule-tests.el=0A+++=20= b/test/lisp/international/mule-tests.el=0A@@=20-48,6=20+48,19=20@@=20= mule-cmds--test-universal-coding-system-argument=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(append=20(kbd=20"C-x=20= RET=20c=20u=20t=20f=20-=208=20RET=20C-u=20C-u=20c=20a=20b=20RET")=20= nil)))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (read-string=20"prompt:")))))=0A=20=0A+(ert-deftest=20mule-utf-7=20()=0A= +=20=20;;=20utf-7=20and=20utf-7-imap=20are=20not=20ASCII-compatible.=0A+=20= =20(should-not=20(coding-system-get=20'utf-7=20:ascii-compatible-p))=0A+=20= =20(should-not=20(coding-system-get=20'utf-7-imap=20= :ascii-compatible-p))=0A+=20=20;;=20Invariant=20ASCII=20subset.=0A+=20=20= (let=20((s=20(apply=20#'string=20(append=20(number-sequence=20#x20=20= #x25)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(number-sequence=20#x27=20= #x7e)))))=0A+=20=20=20=20(should=20(equal=20(encode-coding-string=20s=20= 'utf-7-imap)=20s))=0A+=20=20=20=20(should=20(equal=20= (decode-coding-string=20s=20'utf-7-imap)=20s)))=0A+=20=20;;=20Escaped=20= ampersand.=0A+=20=20(should=20(equal=20(encode-coding-string=20"a&bcd"=20= 'utf-7-imap)=20"a&-bcd"))=0A+=20=20(should=20(equal=20= (decode-coding-string=20"a&-bcd"=20'utf-7-imap)=20"a&bcd")))=0A+=0A=20;;=20= Stop=20"Local=20Variables"=20above=20causing=20confusion=20when=20= visiting=20this=20file.=0A=20=0C=0A=20=0A= --Apple-Mail=_230E54E8-1BE2-40F3-9FB2-C2A479E2BA88 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii --Apple-Mail=_230E54E8-1BE2-40F3-9FB2-C2A479E2BA88--