As you can see from my previous posts, I use some non-latin characters
in mails in my daily life. There is a problem with VM if there are
multibyte characters in the headers.
After hours of debugging, I was able to extract some information of
the problem. When quitting, VM did `vm-stuff-attributes', and inside
that function, `insert-before-markers', to insert the X-VM-v5-Data. I
had a mail with 2 characters e8 b0 83 e8 af 95 (hex, utf-8) in the
subject. What VM tried to insert (as the argument of `insert-before-
marker'), was 8c03 8db5, the code points of those 2 characters. For
some reason, only 03 b5 was written to the INBOX buffer, and finally
saved. In a later session when VM tried to update the mails summary by
reading X-VM-v6-Data in INBOX, the subject containg 03 b5 showed as an
unreadable annoying string.
I guess the utf-8 codes of characters are to be written to INBOX
instead of their code-points? Could you have a look at the code and
see if it is buggy?
Thanks very much!
Yu Ning
--- vm-folder.el.orig 2008-05-24 03:14:12.000000000 +0800
+++ vm-folder.el 2008-05-25 15:26:32.000000000 +0800
@@ -1230,7 +1230,11 @@
(condition-case ()
(progn
(setq oldpoint (point)
- data (read (current-buffer)))
+ data (car (read-from-string
+ (decode-coding-string
+ (buffer-substring
+ (match-beginning 2) (match-end 2))
+ 'utf-8))))
(if (and (or (not (listp data)) (not (> (length data) 1)))
(not (vectorp data)))
(progn
@@ -1806,8 +1810,9 @@
(let ((print-escape-newlines t))
(prin1-to-string attributes))
"\n\t"
- (let ((print-escape-newlines t))
- (prin1-to-string cache))
+ (string-as-unibyte
+ (let ((print-escape-newlines t))
+ (prin1-to-string cache)))
"\n\t"
(let ((print-escape-newlines t))
(prin1-to-string (vm-labels-of m)))
May thanks, your patch will be in 8.0.10.
Robert.