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

From: Eli Zaretskii <[email-masked]>
Date: Sun, 14 Nov 2021 10:25:29 +0200

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: [email-masked],  [email-masked], Alan Third
>  <[email-masked]>
> Date: Sun, 14 Nov 2021 09:18:08 +0100
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > It could be useful to replace the pipe with redirection to a file, and
> > see what you get when invoking the command from Emacs and from a shell
> > prompt outside Emacs.
> 
> Good point.  I tried that now (with "| cat > /tmp/" to get a pipe in
> there), and the contents that were written to file were correct utf-8.
> 
> Mysterious.  Could the problem be in pbcopy -- that's assuming something
> about the coding system when run from inside Emacs somehow?  That
> doesn't sound very likely, but...

Maybe we set some locale-related environment variable, and that was
confuses pbcopy when it is run from Emacs?