Gnus development mailing list
 help / color / mirror / Atom feed
* Is QP bad for binary files?
@ 2001-07-11 23:00 Kai Großjohann
  2001-07-12  1:27 ` Daniel Pittman
  2001-07-12  1:31 ` ShengHuo ZHU
  0 siblings, 2 replies; 4+ messages in thread
From: Kai Großjohann @ 2001-07-11 23:00 UTC (permalink / raw)


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.

Does this really happen?  Can it really happen?

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.

kai
-- 
~/.signature: No such file or directory


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is QP bad for binary files?
  2001-07-11 23:00 Is QP bad for binary files? Kai Großjohann
@ 2001-07-12  1:27 ` Daniel Pittman
  2001-07-12  1:31 ` ShengHuo ZHU
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Pittman @ 2001-07-12  1:27 UTC (permalink / raw)


On Thu, 12 Jul 2001, Kai Großjohann 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.
> 
> 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: 
[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 <CR> to every <LF> 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?

-- 
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 can
say it in three languages.
        -- KMFDF, _Dogma_


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is QP bad for binary files?
  2001-07-11 23:00 Is QP bad for binary files? Kai Großjohann
  2001-07-12  1:27 ` Daniel Pittman
@ 2001-07-12  1:31 ` ShengHuo ZHU
  2001-07-12  1:48   ` Randal L. Schwartz
  1 sibling, 1 reply; 4+ messages in thread
From: ShengHuo ZHU @ 2001-07-12  1:31 UTC (permalink / raw)


Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

> 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.
> 
> Does this really happen?  Can it really happen?
> 
> 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.

I've changed the default to base64 instead of qp-or-base64.

ShengHuo


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is QP bad for binary files?
  2001-07-12  1:31 ` ShengHuo ZHU
@ 2001-07-12  1:48   ` Randal L. Schwartz
  0 siblings, 0 replies; 4+ messages in thread
From: Randal L. Schwartz @ 2001-07-12  1:48 UTC (permalink / raw)
  Cc: ding

>>>>> "ZSH" == ShengHuo ZHU <zsh@cs.rochester.edu> writes:

ZSH> I've changed the default to base64 instead of qp-or-base64.

Me too, because I was getting some PDFs that couldn't be encoded, and
it was very frustrating.

 '(("text/x-patch" 8bit)
   ("text/.*" qp-or-base64)
   ("message/rfc822" 8bit)
   ("application/emacs-lisp" 8bit)
   ("application/x-patch" 8bit)
   (".*" base64))


-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-07-12  1:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-11 23:00 Is QP bad for binary files? Kai Großjohann
2001-07-12  1:27 ` Daniel Pittman
2001-07-12  1:31 ` ShengHuo ZHU
2001-07-12  1:48   ` Randal L. Schwartz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).