Discussion:
[VM] (Still) problems with Latin1 characters in the summary
Johan Vromans
2011-08-17 13:16:50 UTC
Permalink
Using the attached mailbox (small) I can reproduce the following
problem:

* Start GNU/Emacs 23.2 (Fedora14) with "-q" command line option.
* Load VM 8.2.0a (vm-8.0.2a/vm-load.el).
* Mx vm-visit-folder, and point it to the mailbox.

4 messages, all new, are shown. The summary shows "Sheila en René".

* Visit all 4 messages; the status changes from New to Read.
* Save the mailbox.
* Exit Emacs

* Restart emacs.
* Load VM 8.2.0a (vm-8.0.2a/vm-load.el).
* Mx vm-visit-folder, and point it to the mailbox.

4 messages are shown. The summary shows "Sheila en Ren\351".

Inspection of the (saved) mailbox shows that in the X-VM-v5-Data header,
the name "Sheila en René" is stored encoded in Latin1. I very much doubt
if that's correct.

-- Johan
Uday Reddy
2011-08-17 14:14:32 UTC
Permalink
It is working correctly for me. The cached data header is

X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]
["669" "Sunday" "14" "August" "2011" "15:36:22" "+0200" "=?iso-8859-1?Q?Sheila_en_Ren=E9?=" "***@scarlet.nl" "<!&!AAAAAAAAAAAYAAAAAAAAAG4a59WdPkhAtTeC14Ufl5fCgAAAEAAAAGVKIg0C9IRJoqfIIHxPMhsBAAAAAA==@scarlet.nl>" nil "RE: Bezoek Sandy" "^From:" nil nil "8" "2011081414:36:22" "Bezoek Sandy" (number mark " 8/14 =?iso-8859-1?Q?Sheila_en_Ren=E9?= 669 " thread-indent "RE: Bezoek Sandy\n") "<***@phoenix.squirrel.nl>" ("<***@phoenix.squirrel.nl>") nil nil nil nil nil]
nil)

Can you try it with the default VM settings, i.e. without your
.vm.preferences or .vm file? emacs -q is of no help for our purposes.

Cheers,
Uday
Johan Vromans
2011-08-17 15:42:10 UTC
Permalink
Post by Uday Reddy
It is working correctly for me.
Oh...
Post by Uday Reddy
Can you try it with the default VM settings, i.e. without your
.vm.preferences or .vm file? emacs -q is of no help for our purposes.
I thought I defeated all of the private settings.

I moved .vm out of the way (vm.preferences is elsewhere anyway).

With "emacs --no-init-file --no-site-file --load vm-8.2.0a/vm-load.el"
I do, indeed, get the desired results.

With my operational .vm (but without .vm.preferences) I still get good
results.

So it must be some setting in my preferences.

Hmm....

My summary format is:

(setq vm-summary-format "%n %*%a %-18.18UB %-3.3m %2d %4l %UL%I%s\n")

The actual entry in the summary is generated by vm-summary-function-B,
which is part of the bbdb package (file bbdb-vm.el).

(defun vm-summary-function-B (m &optional to-p)
"Given a VM message returns the BBDB name of the sender.
Respects vm-summary-uninteresting-senders."
(if (and vm-summary-uninteresting-senders (not to-p))
(let ((case-fold-search nil))
(if (string-match vm-summary-uninteresting-senders (vm-su-from m))
(concat vm-summary-uninteresting-senders-arrow
(vm-summary-function-B m t))
(or (bbdb/vm-alternate-full-name (vm-su-from m))
(vm-su-full-name m))))
(or (bbdb/vm-alternate-full-name (if to-p (vm-su-to m) (vm-su-from m)))
(vm-decode-mime-encoded-words-in-string
(if to-p (vm-su-to-names m) (vm-su-full-name m))))))

This looks fine at first sight, though.

Any other suggestions?

-- Johan
Johan Vromans
2011-08-17 16:51:19 UTC
Permalink
Post by Johan Vromans
(setq vm-summary-format "%n %*%a %-18.18UB %-3.3m %2d %4l %UL%I%s\n")
The actual entry in the summary is generated by vm-summary-function-B,
which is part of the bbdb package (file bbdb-vm.el).
(defun vm-summary-function-B (m &optional to-p)
"Given a VM message returns the BBDB name of the sender.
Respects vm-summary-uninteresting-senders."
(if (and vm-summary-uninteresting-senders (not to-p))
(let ((case-fold-search nil))
(if (string-match vm-summary-uninteresting-senders (vm-su-from m))
(concat vm-summary-uninteresting-senders-arrow
(vm-summary-function-B m t))
(or (bbdb/vm-alternate-full-name (vm-su-from m))
(vm-su-full-name m))))
(or (bbdb/vm-alternate-full-name (if to-p (vm-su-to m) (vm-su-from m)))
(vm-decode-mime-encoded-words-in-string
(if to-p (vm-su-to-names m) (vm-su-full-name m))))))
This looks fine at first sight, though.
Removing the UB format this seems to solve the problem!

-- Johan
Uday Reddy
2011-08-17 16:52:23 UTC
Permalink
Post by Johan Vromans
This looks fine at first sight, though.
No, it isn't working. As soon as I tried to use it, I got bad characters in
the summary. BBDB hasn't been maintained for a long time, and trying to
puts its data into VM headers isn't very wise.

I will put this on the To-do list to find some decent solutions.

Cheers,
Uday

Julian Bradfield
2011-08-17 14:13:20 UTC
Permalink
Post by Johan Vromans
Inspection of the (saved) mailbox shows that in the X-VM-v5-Data header,
the name "Sheila en René" is stored encoded in Latin1. I very much doubt
if that's correct.
Indeed. This is an old problem, which annoys me a lot. I use a
patched XEmacs which complains loudly about coding errors, so in this
situation I get a complaint each time I save.
Either the X-VM-v5-Data fields should be stored in a fixed universal
encoding, or they should be mime-encoded.
But I haven't got round to fixing it yet!
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
Continue reading on narkive:
Loading...