[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: macOS 12 - cannot override LC_ALL=C setting from environment
From: |
Gavin Smith |
Subject: |
Re: macOS 12 - cannot override LC_ALL=C setting from environment |
Date: |
Sun, 1 Dec 2024 12:24:03 +0000 |
On Sun, Dec 01, 2024 at 12:07:15PM +0000, Gavin Smith wrote:
> So I expect we need to change LC_CTYPE as well. Patrice reported that
> just setting LC_MESSAGES wasn't enough in his testing.
Further to this, the change I sent is probably wrong as the LC_ALL environment
variable takes priority over LC_MESSAGES. I will change this to use
setenv ("LC_ALL", ...) instead.
>
> if (working_locale)
> {
> - setenv_status = setenv ("LANG", working_locale, 1);
> - locale = setlocale (LC_MESSAGES, working_locale);
> + setenv_status = setenv ("LC_MESSAGES", working_locale, 1);
> + || setenv ("LANG", working_locale, 1);
> + locale = setlocale (LC_MESSAGES, "");
> +
> + /* Note that running "setlocale (LC_MESSAGES, working_locale)" directly
> + may not work depending on platform and/or gettext version. */
> }