← Back to team overview

vm team mailing list archive

[Bug 323979] Re: [PATCH] vm-mime.el:vm-mime-encode-words creates garbled X-VM-v5-Data

 

RFC 2047 says in section 5:
+ An 'encoded-word' MUST NOT appear within a 'quoted-string'.
So I think this patch is wrong.

If I read that RFC correctly, the right encoding for the string
"\"Wehikuł czasu"\" is:
"=?utf-8?Q?=22Wehiku=C5=82_czasu=22?="

Looks like there's more to the problem than simply changing a regexp.
Probably we should use some functions from rfc822.el for proper
parsing (I've checked, this file existed in Emacs 18, so it should be
available everywhere).

-- 
[PATCH] vm-mime.el:vm-mime-encode-words creates garbled X-VM-v5-Data
https://bugs.launchpad.net/bugs/323979
You received this bug notification because you are a member of VM
development team, which is the registrant for VM (defunct).

Status in VM - Goto http://launchpad.net/vm for active development: In Progress
Status in VM (View Mail) for Emacs: In Progress
Status in VM 8.0.x series: In Progress
Status in VM trunk series: In Progress

Bug description:
VM 8.0.12
X-VM-v5-Data is encoded by vm-mime.el:vm-mime-encode-words, 
unfortunately, it is not aware of quote marks, so when it encounters 
a string: 
"\"Wechikuł czasu"\" it encodes it as follows:
"=?utf-8?Q?\"Wehiku=C5=82 czasu\"?="
As You can notice, quote marks are inside, making this string impossible to
evaluate later.

My proposed fix is to change vm-vars.el:vm-mime-encode-headers-words-regexp so it doesn't span over " marks.
(see patch)
After this change, string is encoded as follows:

"\"=?utf-8?Q?Wehiku=C5=82?= czasu\""