Subject: bug#51832: Piping unicode text in `shell-command'

From: Eli Zaretskii <[email-masked]>
Date: Sun, 14 Nov 2021 12:56:14 +0200

> From: Philipp <[email-masked]>
> Date: Sun, 14 Nov 2021 11:41:38 +0100
> Cc: Lars Ingebrigtsen <[email-masked]>,
>  [email-masked],
>  [email-masked],
>  [email-masked]
> 
> > I asked once why we push LANG into the environment, instead of calling
> > setlocale, which would only affect Emacs.  I don't think I saw an
> > answer to that question, or did I miss it?
> > 
> 
> AIUI the intention is that this should affect subprocesses started from Emacs.  At least that's how I interpret the comment
> 
> /* macOS doesn't set any environment variables for the locale when run
>    from the GUI. Get the locale from the OS and set LANG.  */

Why is that needed?

And if it is needed, how come we are setting LANG to an invalid locale
and the system somehow sets it to the correct locale?