🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

vm 7.19 and unwanted encoding with iso-2022-jp charset

#591
From: Hans-Christoph Wirth
Date: Thu, 01 Dec 2005 16:58
58 lines
2414 bytes
I have the problem that vm sents my mails with a charset iso-2022-jp
header rather than utf-8 or latin1.

I use vm 7.19 and emacs 21.4.1

After code research I found the following issue:

vm-mime.el contains

----

(defun vm-determine-proper-charset (beg end)
  (save-excursion
    (save-restriction
      (narrow-to-region beg end)
      (catch 'done
	(goto-char (point-min))
	(if (or vm-xemacs-mule-p 
		(and vm-fsfemacs-mule-p enable-multibyte-characters))
	    (let ((charsets (delq 'ascii (vm-charsets-in-region
					  (point-min) (point-max)))))
	      (cond ((null charsets)
		     "us-ascii")
		    ((cdr charsets)
		     (or (car (cdr
			       (assq (vm-coding-system-name
				      buffer-file-coding-system)
;;; watch the line above ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				     vm-mime-mule-coding-to-charset-alist)))
			 "iso-2022-jp"))
		    (t
		     (or (car (cdr
			       (assoc
				(car charsets)
				vm-mime-mule-charset-to-charset-alist)))
			 "unknown"))))

----

On my system, vm-coding-system-name is an alias for symbol-name, which
returns a *string*.  Hence the above marked assq statement compares
the *string* "utf-8" against the *symbol* utf-8 in 
vm-mime-mule-coding-to-charset-alist.  This lookup fails, thus (assq
...) returns nil, and the hard coded default "iso-2022-jp" is used.

For a quick hack I changed 

   (vm-coding-system-name buffer-file-coding-system)

to just

   buffer-file-coding-system

and this seems to work much better for me.  However I am not too deep
in vm to know about the proper use of vm-coding-system-name alias, so 
I don't expect that my hack is of general use.

Any opinions on that?
Technical Details
Message-ID: <slrndouatv.cps.hcw@helvetika.informatik.uni-wuerzburg.de>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: f6829,439828beffc9ad43,start
X-Google-Attributes: gidf6829,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail
From: Hans-Christoph Wirth <hcw@despammed.com>
Newsgroups: gnu.emacs.vm.bug
Subject: vm 7.19 and unwanted encoding with iso-2022-jp charset
Date: 1 Dec 2005 16:58:39 GMT
Lines: 63
Message-ID: <slrndouatv.cps.hcw@helvetika.informatik.uni-wuerzburg.de>
X-Trace: news.dfncis.de AAJ/Fc4n+2a/21bZbtN+1gApsm7DU0CsVb6IbAZUevo0U4
User-Agent: slrn/0.9.8.0 (Linux)