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

Re: Bug#176332: mutt-utf8: mutt mixes up UTF-8 and ISO-Latin-1 attachments



Sebastian Rittau <srittau@xxxxxxxxxxxxxxxxxxx>:

> There is something very strange going on. I just created a file called
> "foo-utf8", which contains umlauts in UTF-8 encoding. Now I performed
> the following steps:
> 
>   srittau@jroger:~$ file foo-utf8
>   foo-utf8: UTF-8 Unicode text
>   srittau@jroger:~$ iconv --from utf-8 --to iso-8859-1 foo-utf8 >foo-iso
>   srittau@jroger:~$ file foo-iso
>   foo-iso: ISO-8859 text
>   srittau@jroger:~$ 
> 
> I have attached both files to this message. As you will notice the
> encoding is exactly the wrong way round.

> Umlauts: äöü

Here the original file was in UTF-8, as expected by Mutt, because
that's what the "charset" variable says. Mutt converts it to
ISO-8859-1, because ISO-8859-1 is mentioned in "send-charset". There
are more people who can read e-mail in ISO-8859-1 than in UTF-8, so it
makes sense to use ISO-8859-1 when possible. Mutt is working perfectly
here.

> Umlauts: ���

Here the original file was in ISO-8859-1. Mutt expects it to be in
UTF-8 and is therefore unable to convert it. Mutt therefore sends the
file unconverted and labels it as UTF-8 because that's what the
"charset" variable says. Mutt is being a bit unfriendly here, but it's
not obvious how to improve it: if one were to make mutt give an error
when it can't convert the file from UTF-8 to UTF-8 then mutt might
stop working on some systems with primitive iconv libraries.

Edmund