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

Re: [Mutt] #3040: charset difference between index browser and



On 2008-03-21 11:42:00 +0100, Alain Bench wrote:
>     The other is using locale_charset() from libcharset, libiconv,
> gettext, or whatever, and should be portable to a whole lot of systems.
> Christian tested it OK on MacOS-X.

My codeset program does the following:

#include <stdio.h>
#include <locale.h>
#include <langinfo.h>

int main (void)
{
  setlocale (LC_ALL, "");
  printf ("%s\n", nl_langinfo (CODESET));
  return 0;
}

But this is exactly what locale_charset() does when nl_langinfo
is available (and I couldn't find any machine when I would need
something else... so, this is OK for me).

> > mutt makes the mistake of assuming that $charset is a good fall-back
> > that will always be a valid MIME charset encoding name.
> 
>     The assumption is that when all normal mechanisms fail, there is
> nothing more appropriate to do than send $charset unconverted. That's a
> last resort fallback. It should not happen in a sane setup.

This is a bad idea, as $charset isn't necessarily a valid MIME charset
(even after stripping the possible suffix). Using the last charset from
$send_charset would be a better choice. Or output an error message (in
most cases, this can be seen either as a configuration bug or as a bug
in Mutt, so, an error message would be a good choice).

IMHO, the fallback to $charset could be used if $send_charset ends with
":", so that the user who wishes to use this fallback can do it.

BTW, it seems that Mutt mixes the locale charset and the editor charset.
This is also something bad. For instance, I use ISO-8859-1 locales (in
an ISO-8859-1 terminal) and want to reply to a message written in UTF-8,
with characters that are not part of ISO-8859-1. Fortunately, my editor
(Emacs) knows how to edit UTF-8 files even when working in ISO-8859-1
locales (if it uses its own window, not the terminal one, it can even
display these characters; otherwise it uses replacement characters for
the display (only)). So, I could theoretically reply to the message
without any loss in the quoted part and send the reply in UTF-8, but
Mutt doesn't let me do so.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)