From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Philipp
Newsgroups: gmane.emacs.bugs
Subject: bug#51832: Piping unicode text in `shell-command'
Date: Sun, 14 Nov 2021 11:41:38 +0100
Message-ID: <9EB4417D-2457-46AD-9198-E42BBAF11071@gmail.com>
References: <834k8fw62v.fsf@gnu.org>
<87y25r8968.fsf@gnus.org> <83mtm7upc4.fsf@gnu.org> <87tugf881r.fsf@gnus.org>
<83k0hbuosm.fsf@gnu.org> <87h7cf84l1.fsf@gnus.org> <87czn383z6.fsf@gnus.org>
<83h7cfuixu.fsf@gnu.org>
Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.20.0.1.32\))
Content-Type: text/plain;
charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
logging-data="22051"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: 51832@debbugs.gnu.org, Lars Ingebrigtsen , alan@idiocy.org,
tor.a.s.kringeland@ntnu.no
To: Eli Zaretskii
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 14 11:42:10 2021
Return-path:
Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.92)
(envelope-from )
id 1mmCxd-0005YO-Qx
for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Nov 2021 11:42:09 +0100
Original-Received: from localhost ([::1]:32980 helo=lists1p.gnu.org)
by lists.gnu.org with esmtp (Exim 4.90_1)
(envelope-from )
id 1mmCxb-0003Bd-RW
for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Nov 2021 05:42:07 -0500
Original-Received: from eggs.gnu.org ([209.51.188.92]:47458)
by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from )
id 1mmCxW-0003BG-6w
for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2021 05:42:02 -0500
Original-Received: from debbugs.gnu.org ([209.51.188.43]:37704)
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.90_1) (envelope-from )
id 1mmCxV-0001QC-VI
for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2021 05:42:01 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
(envelope-from ) id 1mmCxV-00054u-Ny
for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2021 05:42:01 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Philipp
Original-Sender: "Debbugs-submit"
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Sun, 14 Nov 2021 10:42:01 +0000
Resent-Message-ID:
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 51832
X-GNU-PR-Package: emacs
Original-Received: via spool by 51832-submit@debbugs.gnu.org id=B51832.163688650919498
(code B ref 51832); Sun, 14 Nov 2021 10:42:01 +0000
Original-Received: (at 51832) by debbugs.gnu.org; 14 Nov 2021 10:41:49 +0000
Original-Received: from localhost ([127.0.0.1]:49250 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1mmCxI-00054Q-VW
for submit@debbugs.gnu.org; Sun, 14 Nov 2021 05:41:49 -0500
Original-Received: from mail-wr1-f43.google.com ([209.85.221.43]:36429)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from ) id 1mmCxG-00054B-FS
for 51832@debbugs.gnu.org; Sun, 14 Nov 2021 05:41:47 -0500
Original-Received: by mail-wr1-f43.google.com with SMTP id s13so24410363wrb.3
for <51832@debbugs.gnu.org>; Sun, 14 Nov 2021 02:41:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:subject:from:in-reply-to:date:cc
:content-transfer-encoding:message-id:references:to;
bh=V54mFRfVr5Jxducvoi+ce83BCUXvDKO3WQsGQ9qtVhQ=;
b=hZnnym+ygJIruVe+Ser50NnXa0CNE56aU1tHogxrweZvdcC9mO5hnnbxOG0PX/FEXe
zod+bf+mWzLEmGqlEEK8TzYD40s+Xc7qUHRpx4x28L8g/JJJ+o+BMCqqvvlA1pC27Ljw
KZzAkZXaJUKqodK7E0qTJwhYOOzIZ/n4LS2JlykF+UrTM0DqRvXmfOGg2nke6TnMWMcd
dn1VsZP34ZN16Q45mbVbokaRbKNnUKScr5Tu5QdhRXVAZSv5dkcuVyl7C1jCXqnUOwwR
8ICrvO3zCx9LvBZtxuHmpfQGTSaoOwB2rppwKSKB5IPriUy7PpNpwg/WCrnTUojLcw4o
mYcg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc
:content-transfer-encoding:message-id:references:to;
bh=V54mFRfVr5Jxducvoi+ce83BCUXvDKO3WQsGQ9qtVhQ=;
b=2g6xQ5kxK/ksxBWiCUM6vKGQqSCJ+jr5fd9H8wr4U1hZOBATx3aiDhDtb6qafJ5z06
v7AnbHufgsriKKwgoID6Lii/tF/uQg6Ldq1S3ksNk/dXh+vzKjGCQlIglgCBYzJVI7M0
LXDl3IyDMadLEtfoUypnPr+BYUEq4/Ee606zyKgtaCEJslkH/72gCgo6rHmnPhplcREa
xhKx37h5HHGVXcphWHOBkYJ6YK0aKE/Mbvx0hkRwa0QYuyr1Br7F2YBJvj6P8CjPLH0S
JyaB5ZfvZdP9kTQYwtrUdKir6hhPGyOOGfy2H3J4Yb3m1FLOi2wXnVRJ9IJf3VaX2/0M
22Mg==
X-Gm-Message-State: AOAM533jPKpaQBLC2uMV01o+h9pDDhdKPMdqg6R75e/4mmmvrhDyLiTz
BkddC6udjRHVUN/J46lxO48=
X-Google-Smtp-Source: ABdhPJzhXMRnZPwpqC3B/VQl5jQQcQC7H7bLlfJE7rruJwIwLxgfBNoLKM1VBpDD14J+CDGBqt4nag==
X-Received: by 2002:a5d:584e:: with SMTP id i14mr37705065wrf.386.1636886500447;
Sun, 14 Nov 2021 02:41:40 -0800 (PST)
Original-Received: from smtpclient.apple (p57aafa06.dip0.t-ipconnect.de. [87.170.250.6])
by smtp.gmail.com with ESMTPSA id h16sm12077922wrm.27.2021.11.14.02.41.39
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Sun, 14 Nov 2021 02:41:40 -0800 (PST)
In-Reply-To: <83h7cfuixu.fsf@gnu.org>
X-Mailer: Apple Mail (2.3693.20.0.1.32)
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
the Swiss army knife of text editors"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: "bug-gnu-emacs"
Xref: news.gmane.io gmane.emacs.bugs:219925
Archived-At:
> Am 14.11.2021 um 11:31 schrieb Eli Zaretskii :
>=20
>> From: Lars Ingebrigtsen
>> Cc: tor.a.s.kringeland@ntnu.no, 51832@debbugs.gnu.org, =
alan@idiocy.org
>> Date: Sun, 14 Nov 2021 10:46:05 +0100
>>=20
>> NSLocale *locale =3D [NSLocale currentLocale];
>>=20
>> NSTRACE ("ns_init_locale");
>>=20
>> @try
>> {
>> /* It seems macOS should probably use UTF-8 everywhere.
>> 'localeIdentifier' does not specify the encoding, and I can't
>> find any way to get the OS to tell us which encoding to use,
>> so hard-code '.UTF-8'. */
>> NSString *localeID =3D [NSString stringWithFormat:@"%@.UTF-8",
>> [locale localeIdentifier]];
>>=20
>> /* Set LANG to locale, but not if LANG is already set. */
>> setenv("LANG", [localeID UTF8String], 0);
>> }
>>=20
>> And... it's a Macos bug? Googling a bit seems to say that this does
>> indeed return invalid locale identifiers -- just language glued =
together
>> with the country, resulting in identifiers that doesn't match any
>> locales the OS knows about.
>>=20
>> So... I don't know what to do about that. Is there a way to check =
that
>> the identifier is valid?
>=20
> 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?
>=20
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. */