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

Re: Mutt and UTF8 terminals



Hello Ralf,

 On Friday, February 20, 2004 at 1:44:10 PM +0100, Ralf Hildebrandt wrote:

> (xterm with UTF8 character encoding). Is there a way to set the
> set charset = "iso-8859-15" in depency of which terminal I use?

    If "mutt -v" shows "+HAVE_LANGINFO_CODESET", the default $charset is
automagically taken from system locale. So you probably want to set LANG
or LC_CTYPE depending on terminal, in your shell profile. And remove any
$charset declaration from muttrc. Something as:

| case TERM in
|   xterm-u8)   LANG=de_DE.UTF-8 ;;
|   linux-l9)   LANG=de_DE.ISO-8859-15@euro ;;
|   *)          LANG=de_DE.ISO-8859-1 ;;
| esac
| export LANG

    Your $charset will be the good one for each terminal.


    If "mutt -v" shows "-HAVE_LANGINFO_CODESET", the default $charset is
"iso-8859-1", so you'll need to set it explicitly. And still need to set
the locale. So modify the same script, but inserting in each case an
appropriate "export CURRENT_TERMINAL_CHARSET=utf-8", and in muttrc add a
"set charset=$CURRENT_TERMINAL_CHARSET".


    In any case, Takashi Takizawa's JA (or compat) patch is a must-have,
with a static $assumed_charset=windows-1252 or such, and a
$file_charset="ucs-2:utf-8:windows-1252". Patch included in latest
Debian unstable.

    Of course Joël Riou's patch-1.4.jr.config-charset.1 Mads MMJ pointed
out is absolutely usefull, with $config_charset as the charset of your
muttrc (regexes, attributions, aliases, USW...). Even different
$config_charset for different parts of your muttrc (if you have say some
aliases in different language).

    Add a script to auto-recode your .sig, 2 or 3 other tweaks, and
you're done with a very flexible multi-terminals config.


Bye!    Alain.
-- 
Mutt muttrc tip to send mails in best adapted first necessary and sufficient
charset (version for Western Latin-1/Latin-9/CP-850/CP-1252 terminal users):
set send_charset="us-ascii:iso-8859-1:iso-8859-15:windows-1252:utf-8"