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

Re: problem with utf-8 encoding using mutt + vim: solved!



El 27/jul/2005 a las 20:43 -0300, Alain me decía:
> Hi Fernando, *very* nice report.

Thank you, it's the only way to assure one it's not wasting his time
nor others' time. I have to admit that when i start this question in
gentoo-user list first didn't give enough information, but a couple of
answers latter i realized that gonna pass all morning answering: "yes i
already did that" to people trying to help me, so i rephrased it.

> > El Wed, Jul 27, 2005 at 09:04:29AM +0300, Moshe Kaminsky me decía:
> > my ~/.signature is in utf-8, my ~/.alias is too
>     In your muttrc the $attribution string contains a "í" i acute U+00ED
> coded in Latin-1 ED, instead of in UTF-8 C3 AD. This Latin-1 "í" is
> given as-is to vim, autosensed as Latin-1, and converted to UTF-8. You
> see a correct "í" on screen. But the quoted chars that were UTF-8 from
> the beginning are converted too. To garbage.

Incredible! This was the problem. I've readed the FAQ, and then
searched forums, already have read 50 mails from the search in google
groups for: "utf-8 vim mutt" which gives 199 hits, and finded the same
problem but with different solutions, and none worked for me.

Now i would like to add this to the FAQ, but
http://wiki.mutt.org/index.cgi?MuttFaq/Charset is read-only. From what i've seen
in my search for a solution, this problem arise in several ways, this is another
and is not contemplated in the FAQ and i think it would be good to add it, and
also add something like: "Also check that everything is utf-8 compliant if you
want utf-8. Different encoding in .signature, .alias, .muttrc or anyfile you
source could produce unexpected results in the final encoding of your mails."

If someone with acces to the mutt faq in the wiki reads this, please consider
this addition.

For example, now i'm using this for the .signature (just in case):
set signature="fortune -s | iconv -t utf-8 |"

>     Solution: Either convert once for all the full muttrc to UTF-8, or
> insert appropriately "set config_charset=iso-8859-1" before Latin-1
> section, and "set config_charset=utf-8" before UTF-8 section (especially
> where you source ~/.alias).

I prefered converting, i want a system full utf-8 compliant ;)

>     Note that to avoid such oddities, it is also better to disable
> editor's charset autosensing when called from Mutt.

Now that's why this problem doesn't manifest using another editor than
vim!

> >| LC_ALL=es_AR.utf-8
>     Drop it.

Done. But why? Is not a default for everything else?

> >| i got this in my ~/.muttrc:
> >| set send_charset="us-ascii:utf-8"
>     Highly suboptimal: Either drop it, or use the one in infosig.

Using it now, but i wonder why i need iso-8859-15 and windows-1252, it
is that this way i cover all possible holes or something?

> >| set charset="utf-8"
>     Drop it.

Done.

> >| set locale="es_AR.utf8"
>     Keep it, and use it: An English date and time in the middle of a
> Spanish attribution is not so nice.

Done, now i'm using a full compliant spanish attribution, but maybe english
speakers just don't care ;)

A question that should not be here, but is possible to play with $attribution
using an extern command like you do in $signature? Some years ago i was using
pine and can do something for the attribution string like this:

On <date> at <time>, <name> <adverb> <verb>:

This way a can have a cool random attribute string for every different mail.
Sometimes this random combinations were pretty funny. I already try to put:
set attribution="fortune -s |" to test but didn't work.

> > What i didn't tried yet is 'the redmond way', i want to stay away from
> > that metod, if possible.
> 
>     Was ist den das? Ah yes: Uninstall and reinstall Mutt and Vim. That
> is sure a method known to work. ;-)

Well, in this case it wont worked.

Thank you for your help, i am a happy mutt-user now.

-- 
Fernando Canizo - LUGMen: www.lugmen.org.ar - A8N: a8n.lugmen.org.ar
Let's call it an accidental feature.
       --Larry Wall