From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?Arne_J=C3=B8rgensen?= Newsgroups: gmane.emacs.devel Subject: Re: base64 behavior is not MIME compliant Date: Wed, 06 Jul 2005 00:52:52 +0200 Organization: Arne Joergensen -- http://arnested.dk/ Message-ID: <87pstwq30b.fsf@seamus.arnested.dk> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1120604064 22040 80.91.229.2 (5 Jul 2005 22:54:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 5 Jul 2005 22:54:24 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 06 00:54:22 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DpwIg-000353-1q for ged-emacs-devel@m.gmane.org; Wed, 06 Jul 2005 00:53:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DpwJx-0007cO-Di for ged-emacs-devel@m.gmane.org; Tue, 05 Jul 2005 18:55:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DpwJS-0007UH-Ph for emacs-devel@gnu.org; Tue, 05 Jul 2005 18:54:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DpwJR-0007Tf-DX for emacs-devel@gnu.org; Tue, 05 Jul 2005 18:54:46 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DpwJR-0007TC-AW for emacs-devel@gnu.org; Tue, 05 Jul 2005 18:54:45 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DpwOF-0007XQ-BP for emacs-devel@gnu.org; Tue, 05 Jul 2005 18:59:43 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DpwI0-0002xt-PT for emacs-devel@gnu.org; Wed, 06 Jul 2005 00:53:16 +0200 Original-Received: from 213.237.94.152 ([213.237.94.152]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 06 Jul 2005 00:53:16 +0200 Original-Received: from arne by 213.237.94.152 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 06 Jul 2005 00:53:16 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 52 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 213.237.94.152 X-Face: 5t,7/Y$&<1A_t.$vC2{pWZ{m@3_06; kcm]no{hgEL/}Uz(>XV6cl4}xO\v?-h3%>znNaZtq `~rf,GY1T%r=a.zH`hOb(-]'x)nI088Z&|e;V^h;/TShou User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:WrVgOsLvegc8MseirwnwdBTQ+MA= 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 Xref: news.gmane.org gmane.emacs.devel:40475 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:40475 Marc Horowitz writes: > "Richard M. Stallman" writes: > >>> Is there some situation in which the current behavior of >>> base64-decode-region causes an actual problem or confusion for users? > > I never would have noticed this had it not caused me a problem. > > I received a piece of email which passed through an older MTA. This > MTA inserted a ! and a newline after every 1000 characters of a very > long line of base64-encoded data, which used to be common behavior. > When Gnus tried to display this email, it failed, because the ! > characters were not recognized as valid base64 encoding. MIME puts a limit on the line length at 76 characters. So in most cases this will in it self be a broken behavior. (Base64 can probably be used outside MIME too, of course). >>> Is there some situation in which the current behavior provides an >>> advantage? > > The only case I can think of is if a program or the user tries to > base64 decode something which is not base64 encoded, they will receive > an error, instead of some other, possibly confusing behavior. > However, I believe this case is less common than non-transparent MTAs > making small changes to base64-encded data. I actually wrote some code for No Gnus recently that depended on base64-decode-string to throw an error on strings that where not base64 encoded. Then it turned out that XEmacs' implementation of base64-decode-region/base64-decode-string _does_ ignore illegal characters in the base64 encoding. The problem is that we have no other way to detect if a region/string is base64 encoded or not. I thought about doing a decode and then encode and compare the before and after string, but I finally found another to recognize the data (it was a PEM encoded X509 certificate and should therefore begin with "MII"). >>> Also, how does the current development Emacs handle these things? >>> Your report is based on 21.4; the current sources may be different. > > I do not know. I think the behavior is unchanged. Kind regards, -- Arne Jørgensen