From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/36863 Path: main.gmane.org!not-for-mail From: Daniel Pittman Newsgroups: gmane.emacs.gnus.general Subject: Re: Is QP bad for binary files? Date: 12 Jul 2001 11:27:26 +1000 Organization: Not today, thank you, Mother. Message-ID: <87ae2b7x8h.fsf@inanna.rimspace.net> References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1035172378 10839 80.91.224.250 (21 Oct 2002 03:52:58 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 03:52:58 +0000 (UTC) Return-Path: Return-Path: Original-Received: (qmail 23802 invoked from network); 12 Jul 2001 01:28:24 -0000 Original-Received: from melancholia.rimspace.net (HELO melancholia.danann.net) (203.36.211.210) by gnus.org with SMTP; 12 Jul 2001 01:28:24 -0000 Original-Received: from localhost (melancholia.rimspace.net [203.36.211.210]) by melancholia.danann.net (Postfix) with ESMTP id BB5822A823 for ; Thu, 12 Jul 2001 11:28:05 +1000 (EST) Original-Received: by localhost (Postfix, from userid 1000) id B0E5482030; Thu, 12 Jul 2001 11:27:26 +1000 (EST) Original-To: ding@gnus.org In-Reply-To: (Kai.Grossjohann@CS.Uni-Dortmund.DE's message of "Thu, 12 Jul 2001 01:00:18 +0200") X-Homepage: http://danann.net/ X-spies: Marxist FSF Janet Reno Nazi SEAL Team 6 jihad terrorist colonel World Trade Center domestic disruption South Africa North Korea BATF Semtex Watergate User-Agent: Gnus/5.090004 (Oort Gnus v0.04) XEmacs/21.5 (anise) Original-Lines: 70 Xref: main.gmane.org gmane.emacs.gnus.general:36863 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:36863 On Thu, 12 Jul 2001, Kai Gro=DFjohann wrote: > Suppose I send a binary file as an attachment, and it is encoded in > quoted-printable rather than base64. I'm thinking maybe strange > things might happen to line endings in that file. For if I send it > from a Unix system to a Windows system, \n can become \r\n on the way. >=20 > Does this really happen? Can it really happen? Yes, it really happens. No, it shouldn't happen. The problem is that the authors of every major Win32 mail client *know* that Quoted-Printable is *always* text, never anything else. They know this so well, in fact, that they ignore the `application/' part of the MIME type[1] as well as the fact that Gnus has encoded it such that the line endings are encoded in QP and the raw line endings are elided[2]. They then convert it to the local line ending type, in a variety of stupid ways[3], with no notice to the user. Then, finally, they pass the broken result off to the application to display which, unsurprising as this may be, complains that it's binary data[4] has been corrupted and fails. Unless, of course, it's Abode Acrobat, which simply displays an empty page because we all know that error messages scare the user -- and it's better to silently fail than scare the user.[5] > If this really happens, then I think this would be a good reason to > refrain from using QP for binary files. Gnus fairly often uses QP for > PDF files. This breaks the legs of that particular problem for me -- I have not seen an issue with it since: ,----[ .gnus.el excerpt ] | ;; Force application/* to be sent base64; QP vs Win32 breaks things | (require 'mm-encode) | (setq mm-content-transfer-encoding-defaults | (append (remassoc "application/.*" | (remassoc ".*" mm-content-transfer-encoding-defaults)) | '(("application/.*" base64) | (".*" qp-or-base64)))) `---- Daniel Footnotes:=20 [1] Which specifies that this is binary data, not text, and that you better not modify it or you will suffer (and break it) according to the MIME RFC set. [2] This is not only legal but the *required* behavior according to the QP specification, in it's RFC, which explicitly states that this is the way to transport line endings without mangling. [3] Including adding a to every even if there was already one there in at least one case. [4] No matter how much it really was text, because we all know PDF isn't PostScript, honest.[5] [5] Yes, I am bitter. Why do you ask? --=20 You want to be famous and rich and happy, but you're terrified you have nothing to offer this world. Nothing to say and no way to say it, but you c= an say it in three languages. -- KMFDF, _Dogma_