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

Re: problem with Mime headers



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday, May  5 at 06:19 PM, quoth Michael Tatge:
>* On Tue, May 05, 2009 05:33PM +0200 Christoph Kukulies (kuku@xxxxxxxxxxxx) 
>muttered:
>> Yes, in .muttrc I have :
>> set charset="iso-8859-1"        # character set for your terminal
>>
>> That's my output of locale:
>>
>> LANG=de_DE.UTF-8
>> LANGUAGE=de_DE:de:en_GB:en
>> LC_CTYPE="de_DE.UTF-8"
>
>Why charset iso-8859-1 but utf-8 locales? Let mutt autodetect $charset,
>or at least don't let charset differ from your locales.

Michael's right. The reason you don't want your locale and charset to 
disagree is because it confuses the libraries that mutt relies on. For 
example, when displaying characters, mutt needs to know what 
characters are printable and what characters are non-printable (e.g. 
control characters). A standard way to do this is to use the isprint() 
function in libc (this isn't the way mutt does it, but it's a simple 
example). isprint() relies on LANG and LC_CTYPE to figure out what 
characters are printable and what aren't. It assumes that the input 
character is in the charset specified in the locale environment 
variables, which mutt can do. But if you forced mutt to assume that 
the terminal only accepts iso-8859-1 characters, mutt believes 
something different than what isprint() believes, so when handed a 
given character, isprint() may say "sure, that's printable" when it's 
definitely NOT printable in the character set you specified with the 
$charset setting. Does that make sense? In other words: the libraries 
that mutt relies on for handling strings (such as libc) do not 
understand mutt's configuration.

I'm *guessing* that the reason you set $charset to be ISO-8859-1 is 
because your terminal (putty) freaks out when you try to display 
anything else. As it happens, recent versions of putty CAN understand 
UTF-8 output, if you click the right box in their configuration dialog 
box. If you don't want to use UTF8 for whatever reason (e.g. your 
version of putty really really can't handle it), then the right way to 
change it is to change your LANG and/or LC_CTYPE settings rather than 
to change mutt's $charset setting. That way all the software on the 
remote system can agree on what characters are displayable and what 
characters are not displayable.

Does that make sense?

~Kyle
- -- 
In the game of life and evolution there are three players at the 
table: Human Beings,  Nature, and Machines. I am firmly on the side of 
Nature. But Nature, I suspect, is on the side of the Machines.
                                                        -- George Dyson
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iEYEARECAAYFAkoAihoACgkQBkIOoMqOI16jvgCgs9MtU+2Si4SkEwx75xuyzqah
LkUAoNMsiaoMCav0vRPKHdeCODpN6trh
=zbzs
-----END PGP SIGNATURE-----