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

Re: wrong charset



* El 08/05/09 a las 17:47, Kyle Wheeler chamullaba:

> On Friday, May  8 at 06:08 PM, quoth Luis A. Florit:
> > > > But I have three charsets:
> > > >
> > > > $charset=//TRANSLIT
> > > > ?charset=utf-8
> > >
> > > What? That doesn't make any sense. Are those two lines actually in
> > > your muttrc?
> >
> > The only thing in my .muttrc is 'set charset=//TRANSLIT'.
>
> Try removing that from your muttrc entirely.

I did it, and mutt sets charset=utf-8.

> > But no matter how I change that, the result is always utf-8.
>
> Hmmmm. That suggests that something somewhere else is changing it. Is
> there a systemwide muttrc that's setting the $charset maybe? If you
> tell mutt to use a null muttrc (e.g. `mutt -F /dev/null`) does it
> still say that $charset is utf-8?
>
> > When I do ':set charset' I get 'charset="//TRANSLIT"' (as expected,
> > although in this case it means UTF-8 despite of the fact that my
> > xterm is ISO-8859-1).
>
> What makes you think it means utf-8?

Because ':set ?charset' gives 'charset=utf-8', and because the
accented characters appear as garbage.

> > If I change to iso-8859-1, I get accented characters as \123.
>
> That's because your $charset doesn't match your locale.

Even exporting LC_ALL=pt_PT gives \NNN.

> In any case, a value of iso-8859-1//TRANSLIT should remedy that.

No, still as \NNN...

> > I have always used as locale 'LANG=en_US' in a ISO-8859-1 rxvt
> > console, and 'charset=\\TRANSLIT' or iso-8859-1 in muttrc, and
> > everything worked fine. So I don't think this has to do with
> > locales. It seems that mutt does not understand the osso-xterm...?
>
> The terminal shouldn't matter in this case.

Perhaps I should have said this before, but I use the very same .muttrc
in Fedora and Nokia. Both Fedora's iso-8859-1 rxvt and xterm
show chars perfectly. It's the Nokia that doesn't. And both have
the same locales: everything as en_US. What could it be, but the
console?

> Okay, before we get too twisted up here, first, let's make sure your
> locale setup is correct. Since perl is usually sensitive to proper
> locale settings, try doing this:
>
>      perl -e ""
>
> That SHOULD do nothing at all.

Yep, nothing.

> If it complains, then your locale settings are invalid. To prove
> that it will complain if your locale is invalid, try this:
>
>      env LC_ALL=nocharset perl -e ""
>
> That *should* generate a big ugly warning.

Yep, it did...

> But, if perl is happy and mutt with a null config file thinks
> $charset should be utf-8, then your pt_BR locale is set up to only
> work with utf-8.

In fact, I've never set LANG to be anything but plain en_US with
no problems.

> > > 1. When you run mutt, it reports that the charset it thinks is
> > > appropriate is utf-8
> >
> > Yes, if I use 'set charset=//TRANSLIT'
>
> So... don't do that.

I tried with everything...

> > > 2. Nothing you seem to do can convince mutt to avoid utf-8
> >
> > No, now it accepts 'set charset=iso-8859-1', but still displays
> > accented characters as \123.
>
> Right. Because the $charset doesn't match the locale environment
> settings (i.e. what your computer thinks the charset should be based
> on the LANG and/or LC_CTYPE variables isn't iso-8859-1 for some
> reason).

Perhaps all the Nokia locales are UTF-8 based...?

    Thanks a lot for your efforts, Kyle!!!

        Best,

            L.