On Sat, Aug 26, 2006 at 03:15:21AM +0200, Adeodato Simó wrote: > > I'm using a latin1 terminal, but I've set up vim to use utf-8 files by > > default, but fall back to latin1. Vim also shows latin1 on the screen. > > But I can't seem to get mutt and vim to agree on the charset for the > > file being used. > > Hm. Mutt assumes that the contents provided by the user editor are in > $charset, which is reasonable since this variable is initialized from > the user's locale automatically. > > As far as I know, there is no way to tell Mutt that the files provided > by the editor are in some other encoding. And you really don't want to > change $charset by hand, since then it won't match your terminal > encoding, and will be unable to read the text. > > In your scenario, I think the interesting question is why you have: > > > In vim: ":set fileencoding" returns: > > fileencoding=utf-8 > > Did you set it by hand?
What I did was tell vim that it should internally store things in utf-8 by setting "encoding=utf-8". This also has as effect that it changes the default for fileencodings to "ucs-bom,utf-8,latin1". The value of encoding is also based on the terminal settings, but has nothing to do with either the fileencoding (which is based on fileencodings) or the termencoding. Note that I've also filed a bug against vim to change that behaviour a little. > > It seems that mutt always considers the encoding of the filename to be > > the same as for the terminal, and that's not really what I want. > > Why, if I may ask? Seems like a not-that-useful setup. But hey, if > that's what you really really want, all I can offer you is a macro: > > macro compose y "<first-entry><edit-type>\Cutext/plain; > charset=utf-8<enter>n<send-message>" > > This basically overrides "y" to "hey, Mutt, my editor gave you utf-8" + "y". This seems to be working, but I think I'll end up with problems replying to latin1 mails for which mutt stores the file in latin1, and then I'll end up sending a latin1 mail with headers claiming it to be utf-8. > > So, I was reading the documentation, and it seems that the only thing > > that I should consider changing seems to be file_charset. I've tried > > setting that to various things like just "utf-8", or > > "utf-8:iso-8859-1", but it doesn't seem to be changing anything. > > I think file charset applies to text attachments, but not to the text > body itself, I think. Yes, that's what it says, and I was hoping it did more than that, but it doesn't seem to. Kurt