From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/25189 Path: main.gmane.org!not-for-mail From: Kim-Minh Kaplan Newsgroups: gmane.emacs.gnus.general Subject: Re: [PATCH] [BUG] Binary attachments use wrong encoding (was Re: PDF's as base64 vs. Q/P encoded attachments) Date: Wed, 22 Sep 1999 14:16:04 GMT Organization: SunSITE Denmark (sunsite.auc.dk) Sender: owner-ding@hpc.uh.edu Message-ID: <87puzbf2vx.fsf@kloug.western.fr> References: <87d7vbi8qc.fsf@kloug.western.fr> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035162621 12716 80.91.224.250 (21 Oct 2002 01:10:21 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 01:10:21 +0000 (UTC) Return-Path: Original-Received: from bart.math.uh.edu (bart.math.uh.edu [129.7.128.48]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id KAA01780 for ; Wed, 22 Sep 1999 10:17:57 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by bart.math.uh.edu (8.9.1/8.9.1) with ESMTP id JAB12919; Wed, 22 Sep 1999 09:17:55 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 22 Sep 1999 09:18:23 -0500 (CDT) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id JAA28437 for ; Wed, 22 Sep 1999 09:18:13 -0500 (CDT) Original-Received: from sunsite.auc.dk (sunsite.auc.dk [130.225.51.30]) by sclp3.sclp.com (8.8.5/8.8.5) with SMTP id KAA01732 for ; Wed, 22 Sep 1999 10:16:10 -0400 (EDT) Original-Received: (qmail 5266 invoked by uid 509); 22 Sep 1999 14:16:05 -0000 Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: emacs.ding Mail-Copies-To: never X-Face: C!5Mk_!qB]35}VpD|H>GN/@fk%~7:*/x8&~\]|r|)/zV?rJ){uX4Nh`a$L/z__Kx4Gt!mDU 3kZlj)F2]Ds$?l';SO9]v^|[i2nY`pZ+mu+HT%5ITkuP#e]@8F4@Hc.=]oN1+d\M@Rl>-$C?h$yntf -JVx)3L2}VzG.!bQEy]~I_3fup`HtZ^t/Iz.|Vh$~o`^g\ User-Agent: Gnus/5.070096 (Pterodactyl Gnus v0.96) XEmacs/20.4 (Emerald) Original-Lines: 36 Original-NNTP-Posting-Host: 195.101.52.192 Original-X-Complaints-To: news@sunsite.auc.dk Original-X-Trace: sunsite.auc.dk 938009764 195.101.52.192 (Wed, 22 Sep 1999 16:16:04 MET DST) Original-NNTP-Posting-Date: Wed, 22 Sep 1999 16:16:04 MET DST Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:25189 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:25189 Hum, in the following, the 'SAVE-RESTRICTION' has to be a couple of lines above. Sorry. Kim-Minh Kaplan writes: > --- mm-encode.el.orig Wed Sep 22 11:31:49 1999 > +++ mm-encode.el Wed Sep 22 11:32:41 1999 > @@ -126,10 +126,12 @@ > > (defun mm-qp-or-base64 () > (save-excursion > - (save-restriction > - (narrow-to-region (point-min) (min (+ (point-min) 1000) (point-max))) > - (goto-char (point-min)) > - (let ((8bit 0)) > + (let ((8bit 0) > + (start (point-min)) > + (end (min (+ (point-min) 1000) (point-max)))) > + (narrow-to-region start end) > + (goto-char start) > + (save-restriction > (cond > ((not (featurep 'mule)) > (while (re-search-forward "[^\x20-\x7f\r\n\t]" nil t) > @@ -141,9 +143,9 @@ > (unless (eobp) > (forward-char 1) > (incf 8bit))))) > - (if (> (/ (* 8bit 1.0) (buffer-size)) 0.166) > + (if (> (/ (* 8bit 1.0) (- end start)) 0.166) > 'base64 > - 'quoted-printable))))) > + 'quoted-printable))))) > > (provide 'mm-encode) >