<<< Date Index >>>     <<< Thread Index >>>

Re: Emacs, mutt and a problem with locales



On date Sunday 2006-12-24 12:18:26 +0100, Ismael Valladolid Torres muttered:
> I am running Debian unstable, and I use mutt extensively for reading
> mail and GNU Emacs as the editor for the mail client.
> 
> Emacs version is 21.4.1 (modified by Debian!) and Mutt version is
> 1.5.13, where debianized Mutt include patches below.
> 
> patch-1.5.11.rr.compressed.1
> patch-1.5.4.vk.pgp_verbose_mime
> patch-1.5.5.1.nt.xtitles.3.ab.1
> patch-1.5.6.dw.maildir-mtime.1
> patch-1.5.6.tt.assumed_charset.1
> 
> LANG is es_ES.UTF-8 and there is no other LC_* environment variable
> defined.
> 
> The problem is that Mutt shows properly any message with the correct
> encoding, even I see oriental symbols in spam received with the
> iso-2022-jp encoding. But when I answer a message with spanish special
> characters, Emacs opens and everything starts behaving unproperly.
> 

I suggest you to use UTF-8 both as the system and the emacs default
encoding.

Try this in your .emacs:
(set-language-environment "UTF-8")   

while in muttrc:
set charset="UTF-8"

I think this variable sets the encoding for the file passed to the
editor, that will use its default encoding.

Maybe you're using UTF-8 as your mutt encoding, so when mutt sends a
file to the editor it (eventually) recodes it with UTF-8, then emacs
opens it with its default encoding (I think it's setted by default to
iso-8859-1). 

You could change this with an emacs hook, but I think it's safer to
preserve consistency across the various system applications.

HTH
-- 
Stefano Sabatini
Linux user number 337176 (see http://li.count.org)