From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dante Catalfamo Newsgroups: gmane.emacs.help Subject: Re: encoding in shell-command and subshell Date: Mon, 23 Aug 2021 19:09:54 -0400 Message-ID: References: <522AE6E1-5494-4928-9034-6F6BB7ACBDC6@traduction-libre.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12370"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 24 01:17:32 2021 Return-path: Envelope-to: geh-help-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 1mIJC5-0002yd-Nd for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 24 Aug 2021 01:17:31 +0200 Original-Received: from localhost ([::1]:40464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIJC4-00078F-F4 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 23 Aug 2021 19:17:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50406) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIJAy-0006W3-Nj for help-gnu-emacs@gnu.org; Mon, 23 Aug 2021 19:16:20 -0400 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:47185) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIJAw-00038E-Uk for help-gnu-emacs@gnu.org; Mon, 23 Aug 2021 19:16:20 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 4B29F32001FC for ; Mon, 23 Aug 2021 19:09:56 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 23 Aug 2021 19:09:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lambda.cx; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=c Zv0EGKaFnAR1p2XrtJxwF5i2kKi57DZhxSo++2ETGM=; b=c+cgZ3qdaNeKbJ3fi /+UmfMEJetijy0BDX7IaFqqBTJ1c2mo21TawCmOA0SrqXGTeP9akfhnEH+LPuKDr 1dnzM4rJzYTsoJwbvsW6xIEqk3KZef9kdPuTKMTOrKCWuGzFHwLoZL/0b7VnsNke 1URXYtXEI0FyACh70TaEKBQPPmst9Y4/znIWbDf/gUIuHAE8Ok85iEfzN526Grfn 72aEpiQILhDhyKlEu1LwedEETHrPCL8Yi9KP/TcRb/V3F8iZ1AkhyoMBZp9KRJ5G 4S5SOFvmKdxXjf8Unul5T/PcKwJFsIPJXDLqAkfX0pOpg/sZ6cWLj5N6cvtNf2xQ 3G01Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=cZv0EGKaFnAR1p2XrtJxwF5i2kKi57DZhxSo++2ET GM=; b=ms6OH28nX4HXX0QW/5wuxoUPYLzscPT/NiVKZLt3Bghjut96Mmye2+URS 4muTTY30YqFd0J1KSttA81BrEGva/faBVUhuUZm3sN5xom/m20d5R8r2f5GGdi3o tcMdt2KV4OaJOaWHWb3V5lrSh8aY0mtJyaDakTptipgK/8grtHZRoouHZBBSsTLz POIuszr1ye+CFe1Ln2sRmRKei2BMd7zUaD8+yJqoE4esybOxEE/wKiBXEISYucKp KSoYLc+Tazuq8y2qbqdFQZ+TYs7Fs77ox05obEU5O0YFkbMG/5kbcLhV7fKS/7s2 J1iekoFTZlDyX5mxLUWHlambf7y/w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddtiedgudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtje ertddtfeejnecuhfhrohhmpeffrghnthgvucevrghtrghlfhgrmhhouceouggrnhhtvges lhgrmhgsuggrrdgtgieqnecuggftrfgrthhtvghrnhepheeiudfffeeihfdvvedutdeile evjeetheevleekgefggfekjeegvdejgfegvedtnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomhepuggrnhhtvgeslhgrmhgsuggrrdgtgi X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 23 Aug 2021 19:09:55 -0400 (EDT) In-Reply-To: <522AE6E1-5494-4928-9034-6F6BB7ACBDC6@traduction-libre.org> Content-Language: en-CA Received-SPF: pass client-ip=64.147.123.24; envelope-from=dante@lambda.cx; helo=wout1-smtp.messagingengine.com X-Spam_score_int: -47 X-Spam_score: -4.8 X-Spam_bar: ---- X-Spam_report: (-4.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-2.023, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:132705 Archived-At: How are you launching Emacs? It's possible the environment variables aren't defined when Emacs is launched. I know this is a problem on MacOS or when you launch it using something like systemd. The `exec-path-from-shell' package will probably solve the problem for you. It opens a shell and pulls all the environment variables from it. On 8/23/21 7:01 AM, Jean-Christophe Helary wrote: > When I run shell-command with javac on a class that contains non ASCII charaters, I get garbage. > > When I open the subshell and run the same command inside it, it picks by Java encoding environment declaration (.profile): > > export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8 > > and works without problems. > > The workaround is that I have to declare the encoding in the shell-command. > > Why is that ? Is there a way to have the subshell from shell-command pick my environment variables ? >