Hello Derek,

On 2024-03-29 16:47:22, Derek Martin wrote:
> On Sat, Mar 23, 2024 at 07:41:45PM +0800, Sadeep Madurange wrote:
> > Initially, LANG was unset and LC_CTYPE="C". The character encoding
> > was US-ASCII. I changed these variables (i.e., LANG, LC_CTYPE and
> > locale settings) to en_US.UTF-8. Then the ? changed to ?. So, looks
> > like you are on to something. I will check this with OpenBSD
> > community as well.
> > 
> > In Xdefaults, I have set XTerm*utf-8 setting to true as well.
> 
> Your problem is that these settings are not consistent (and you still
> have this problem, because the "solution" proposed by Sirius is
> incorrect--even if it appears to have solved your issue).  By having
> LANG unset, you've told your shell (and therefore everything started
> by it) to use ASCII, but you've explicitly told xterm to use Unicode.
> That's wrong.
> 
> The TL;DR of this is:
> 
> 1. You should NEVER need to set Mutt's charset explicitly. [*]
> 2. Your shell, Mutt, and X should all inherit what they need from your
>    LANG environment variable, assuming it is set properly for your
>    system and environment (it definitely isn't in your case).
> 3. Setting Mutt's charset may appear to "work" but it's not the
>    correct solution, because your shell and terminal settings are
>    still inconsistent.  You'll have trouble with other things later if
>    you don't fix this.
> ________________________________________________________________
> [*] Except in extremely rare and completely esoteric cases that apply
>     only to experts... and by now should really apply to no one.

Thank you for patiently explaining. That was very educational. This is
what I used to do on Linux in the past, though, without knowing why.

Unfortunately, this doesn't seem to work on OpenBSD. So, perhaps this
qualifies as one of the esoteric cases. OpenBSD doesn't seem to pay much
attention to the LANG variable. Thw following is an excerpt from the
locale man page:

"Programs in the OpenBSD base system ignore the locale except for the
character encoding, and it is not recommended to use any of these
variables except that the following non-default setting is supported as
an option: 

        export LC_CTYPE=en_US.UTF-8" [1]

[1] https://man.openbsd.org/locale.1

-- 
Sadeep Madurange
PGP: 103BF9E3E750BF7E

Reply via email to