From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#51832: Piping unicode text in `shell-command' Date: Sun, 14 Nov 2021 12:31:57 +0200 Message-ID: <83h7cfuixu.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21496"; mail-complaints-to="usenet@ciao.gmane.io" Cc: tor.a.s.kringeland@ntnu.no, 51832@debbugs.gnu.org, alan@idiocy.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 14 11:33:09 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 1mmCou-0005Ob-Qs for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Nov 2021 11:33:09 +0100 Original-Received: from localhost ([::1]:48404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmCot-0002mW-Fn for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Nov 2021 05:33:07 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmCoo-0002mA-2y for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2021 05:33:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37694) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmCon-0000Ni-Qv for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2021 05:33:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mmCon-0004r1-Lm for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2021 05:33:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Nov 2021 10:33: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.163688594018605 (code B ref 51832); Sun, 14 Nov 2021 10:33:01 +0000 Original-Received: (at 51832) by debbugs.gnu.org; 14 Nov 2021 10:32:20 +0000 Original-Received: from localhost ([127.0.0.1]:49240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmCo7-0004q1-NT for submit@debbugs.gnu.org; Sun, 14 Nov 2021 05:32:19 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45242) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmCo5-0004po-Vf for 51832@debbugs.gnu.org; Sun, 14 Nov 2021 05:32:18 -0500 Original-Received: from [2001:470:142:3::e] (port=50364 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmCnz-0000Jv-TA; Sun, 14 Nov 2021 05:32:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=lwhqPFNi9x8sxUJdOrNtI7TSOFC65832rSsa54eAWlY=; b=DfooETk42Bgm NDGMgXpTX36c1TxPE5+/WNy0nVPex5zWLtSaQjIG8LEsi0Yj1DGOFIeDskzfHgx6SPxTJbqprUDWj IlK39i4mBpQ6qzJP1YQD1Sw18SeEL3+Gb58hQm1AZDaR06VJ6PBfkQeXzTPZ8WY21DTJcuSjsg77o DrjLVxEcku2nzvJMXzomPCn2kVAvSDy+SGQAv1QtLaVpbeQ9qEd1aOhETppMqCrRTbi4R+X/u4R8R ZVoYrFttJ/gqqwV7SURCtebm748vJxGirBNFplB8hp2JpOtAb+PaXndF3Ryol1FVlcOjA7fb0ikeh +yIe2EeZkuIcWiVajid6Xg==; Original-Received: from [87.69.77.57] (port=4815 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmCny-0003XM-T1; Sun, 14 Nov 2021 05:32:11 -0500 In-Reply-To: <87czn383z6.fsf@gnus.org> (message from Lars Ingebrigtsen on Sun, 14 Nov 2021 10:46:05 +0100) 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:219923 Archived-At: > 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 > > NSLocale *locale = [NSLocale currentLocale]; > > NSTRACE ("ns_init_locale"); > > @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 = [NSString stringWithFormat:@"%@.UTF-8", > [locale localeIdentifier]]; > > /* Set LANG to locale, but not if LANG is already set. */ > setenv("LANG", [localeID UTF8String], 0); > } > > 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. > > So... I don't know what to do about that. Is there a way to check that > the identifier is valid? 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?