🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.vm.bug
Article #466

Re: feature request: B-encoding in headers

#466
From: Yuning Feng
Date: Fri, 23 May 2008 07:47
31 lines
2644 bytes
On May 22, 2:51 pm, Yuning Feng <fengyuning1...@gmail.com> wrote:
> supported also. It seems Gmail requires B-encoding of the subject
> field for gb2312/gbk (2 charsets for zh-CN, should not limited to
> those 2) characters to be contained there.

I was wrong. The mail I sent had a bad MIME encoded subject header,
which is done by VM. It is not VM's fault, however.

The incorrect header was caused by the following expressions in vm-
rfaddons.el: vm-mime-encode-headers

   (when (and coding (not (eq coding 'no-conversion)))
     (goto-char end)
     ;; this is a bug of encode-coding-region, it does not return
     ;; the right length of the new text, but always 0
     (let ((old-buffer-size (buffer-size)))
       (encode-coding-region start end coding)
       (setq end (+ end (- (buffer-size) old-buffer-size)))))

I was using emacs 23.0.60, and that bug of encoding-coding-region
seemed to be fixed. As a result, the var "end" was greater than it
should have been. In my case of testing, the region between "start"
and "end" was including the end mark "?=" and part of the following
line.  Then, the end mark "?=" was eaten by vm-mime-Q-encode-region.

Now, I have changed the code to be:

   (when (and coding (not (eq coding 'no-conversion)))
       (encode-coding-region start end coding))

and things are fine.
Technical Details
Message-ID: <b0293111-702a-4f54-845e-5cf59b306089@a32g2000prf.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!postnews.google.com!a32g2000prf.googlegroups.com!not-for-mail
References: <339c95af-a3d1-458b-982b-55405768aa9b@w4g2000prd.googlegroups.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: f6829,2757855d22526eb6
X-Google-Attributes: gidf6829,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!postnews.google.com!a32g2000prf.googlegroups.com!not-for-mail
From: Yuning Feng <fengyuning1984@gmail.com>
Newsgroups: gnu.emacs.vm.bug
Subject: Re: feature request: B-encoding in headers
Date: Fri, 23 May 2008 00:47:14 -0700 (PDT)
Organization: http://groups.google.com
Lines: 31
Message-ID: <b0293111-702a-4f54-845e-5cf59b306089@a32g2000prf.googlegroups.com>
References: <339c95af-a3d1-458b-982b-55405768aa9b@w4g2000prd.googlegroups.com>
NNTP-Posting-Host: 123.116.142.86
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1211528834 24748 127.0.0.1 (23 May 2008 07:47:14 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 23 May 2008 07:47:14 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: a32g2000prf.googlegroups.com; posting-host=123.116.142.86; 
 posting-account=bvwfvwoAAABlct2doviPC8TY7mWSAGRz
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.8.1.14) 
 Gecko/20080404 Iceweasel/2.0.0.14 (Debian-2.0.0.14-0etch1),gzip(gfe),gzip(gfe)