I can’t believe this can be so difficult! I’ve for a long time used Emacs and VM for one of a couple of email accounts. It’s great, fast and wonderful. However, Emacs VM doesn’t deal with IMAP that well and I decided last month to ditch it for Mutt.
Using Emacs/VM I used ISO 8859-1 which worked with Norwegian/German characters well after messing around with various LC_, locale and terminal settings. Also, I want this to work 100% with all Emacs shortcuts, not using some stupid terminal emulator that grabs my Alt key when switching to international mode.
Now, when venturing into the exciting land of Mutt, I (finally) decided to switch to UTF-8 and had all the old fun/non-sense once again with locales, terminal settings, .emacs variables and so on. This is something I just want to work!
Ok, this is how I got it working 100% (not 90% with Ctrl-L distorting the displayed text and other annoyances):
Local environment:
My .bashrc
LC_ALL=en_GB.UTF-8
My terminal emulator of choice is urxvt it can do UTF-8 character sets while retaining the Alt key as Emacs Meta without having to mess around in /etc/inputrc
External/SSH environment :
No LC_ variables set. and having the following language related settings in .emacs (note the commented out line):
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Language Settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; (set-language-environment "Latin-1") (set-keyboard-coding-system 'utf-8)
Lastly, in my .muttrc, I’ve got this (although this is only used for displaying the inboxes and messages, not composing them as I use Emacs for this):
set charset="utf-8" set locale = no_NO
So now, I get full UTF-8 support as well as Emacs shortcuts when running Mutt/Emacs inside an SSH session!