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

Re: locale problem



On Thu, Aug 19, 2004 at 11:52:04AM +0000, Bruno Lustosa wrote:
> Hi. Sorry for taking so much to respond.
> I have tried some configurations here, and there are some messages where
> it always fail. Messages sent by myself are ok.

Well, as I pointed out last time, they're not (or at least the last
one wasn't).

> I tried to rename my .muttrc, and the problem persists.
> I think it's something I must set, and not something that's already
> wrong on mutt's part, at least.

Can you be more specific about when the problem occurs?   Can you
provide a link to a mailbox which exhibits the problem?

> I know this is a mutt list, but there should be a way to convert all
> incoming mail to utf-8 using a procmail recipe (along with 'recode'),
> but I don't know if it's a bad idea.

I'm not sure that there is...  You could pipe it through iconv, but
you will probably break the mail.

> When I start gnome-terminal, LANG is set to en_US.UTF-8.

Ok, that's fine, but how are you starting gnome terminal?  You didn't
actually answer my question...  Even if you set your locale properly
in your .bashrc or whatever, the gnome-terminal may still be started
with a different locale if it is started by your window manager.  For
example, if your system's default locale is different from that which
you have set in your .bashrc, the windowing system may not (and
probably won't) read your .bashrc before it starts, so programs
started from it will have the system's default locale, NOT the one you
defined in your .bashrc file.

The above depends on your default system locale, as well as how the
windowing system was started...  If the system's default locale is
en_US, and the windowing system is started at boot time, then programs
started by it may actually be started with a locale of en_US.  This
will cause problems.

> Just to show that it isn't mutt-specific, there is a script I copied
> from a iso8859-1 machine, and when I run it, I don't see the accented
> characters (they are printed out). If I invoke it in vim, I see them
> properly.

The problem here is that the characters are being output using an
encoding which is different from your locale.  In other words, the
script is sending iso-8859-1 characters to your terminal, but the
terminal is interpreting them as UTF-8 characters.  Any codes which
don't map the same in both locales will be errors.

For characters to be displayed properly, all of the following must
match locale:

 - the locale which your terminal was started with
 - the actual characters being sent to the terminal
 - the locale of the shell being run by your terminal
 - the font used to display the characters

In the case of e-mail, the received e-mail's MIME type must also
match.  If the charset of the data being written to the terminal is
different from the charset of your terminal, then you need to use
iconv to convert it.  However, if you have your settings set properly,
mutt should do this for you.  

So, please identify a specific message which exhibits the problem, and
then answer the following questions:

1. What is the character set named in the Content-Type field of the
   message?

2. What is the complete output of the locale command on your terminal
   prior to starting

3. What is the system's default locale?

4. After you start mutt, what is the value of $charset (in mutt)?

5. Are you sure your font can display all the relevant glyphs?

6. What is the vaule of mutt's $send_charset?

-- 
Derek D. Martin    http://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail.  Sorry for the inconvenience.  Thank the spammers.

Attachment: pgpFor3ELNDOP.pgp
Description: PGP signature