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#71500: 28.2; Can't create/open .gpg file name contains non-ascii encoding in windows Date: Sat, 29 Jun 2024 14:25:30 +0300 Message-ID: <868qyoj8id.fsf@gnu.org> References: <86sexi1tu0.fsf@gnu.org> <867cea7shh.fsf@gnu.org> <85ikxt485b.wl--xmue@d1.dion.ne.jp> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2130"; mail-complaints-to="usenet@ciao.gmane.io" Cc: billy.hotwind@gmail.com, 71500@debbugs.gnu.org To: Kazuhiro Ito Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 29 13:26:24 2024 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 1sNWDn-0000KO-Uf for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 29 Jun 2024 13:26:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sNWDW-0000o3-Fs; Sat, 29 Jun 2024 07:26:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sNWDT-0000na-6T for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2024 07:26:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sNWDS-0005Nf-To for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2024 07:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sNWDS-00020d-5a for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2024 07:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Jun 2024 11:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71500 X-GNU-PR-Package: emacs Original-Received: via spool by 71500-submit@debbugs.gnu.org id=B71500.17196603487702 (code B ref 71500); Sat, 29 Jun 2024 11:26:02 +0000 Original-Received: (at 71500) by debbugs.gnu.org; 29 Jun 2024 11:25:48 +0000 Original-Received: from localhost ([127.0.0.1]:37185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNWDE-00020A-0h for submit@debbugs.gnu.org; Sat, 29 Jun 2024 07:25:48 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41080) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNWDC-0001zw-Ep for 71500@debbugs.gnu.org; Sat, 29 Jun 2024 07:25:47 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sNWD5-0004uD-CU; Sat, 29 Jun 2024 07:25:39 -0400 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=Sce9G6RMKuGPnbISOvbDvOCy+vsj2s3hiTNJVmpMnHk=; b=DN6/XwIvH3Up GqNVfE5/z6KPL97EY7JzrToVYz4xJdiPprYAvm3jYw0pxBpoUhv+NrHiOz33CfFg4At8u9ixUXsHf FylXijTVe9m79YEDRqxwLY5Qk0aEiBI1b8PSB1dgf9j8YReF6R1LGaI4tlkQQIcoBdiDeqo8hF4tf bdHB5pLlcvY71plFsMid0cfhTIkJe6v3QH459adIfJIpwUzIRi/14f2FGO772ARBXjYnamM/SK1wa TdhiM1YT7J6q/vB0Uyr+qIdtdfYfC0FDkMH+HzlzyMYQPjFwCvJG9JirX/WtPdPW/uu62HrACRNjL 7GxtvhjB58lY3l+CCaHoYw==; In-Reply-To: <85ikxt485b.wl--xmue@d1.dion.ne.jp> (message from Kazuhiro Ito on Fri, 28 Jun 2024 20:30:08 +0900) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:288106 Archived-At: > Date: Fri, 28 Jun 2024 20:30:08 +0900 > From: Kazuhiro Ito > Cc: billy.hotwind@gmail.com, eliz@gnu.org > > > Ping! Did you have a chance to try Emacs 30 (now on the emacs-30 > > branch of the Emacs Git repository)? > > Unfortunately, the issue is not resolved. > > As Tatsuya wrote, epg--start function calls gpg2 program with setting > :coding property to raw-text, thus each argument should be encoded in > proper coding system by a caller. The problem would occur on any OS > whose file name coding system was not utf-8. > > For example, in case of epg-decrypt-file, following change is required > if we need to set :coding property to raw-text for ENCODING. > > diff --git a/lisp/epg.el b/lisp/epg.el > index 7bec91f616d..59870761565 100644 > --- a/lisp/epg.el > +++ b/lisp/epg.el > @@ -1468,7 +1468,10 @@ epg-decrypt-file > (progn > (setf (epg-context-output-file context) > (or plain (make-temp-file "epg-output"))) > - (epg-start-decrypt context (epg-make-data-from-file cipher)) > + (epg-start-decrypt context > + (epg-make-data-from-file > + (encode-coding-string > + cipher file-name-coding-system))) > (epg-wait-for-completion context) > (epg--check-error-for-decrypt context) > (unless plain Thanks, but this doesn't look right to me. The problem is likely in the fact that epg--start sets the encoding/decoding for the epg process to raw-text in a way that is too broad: it affects not only how we encode and decode text sent to and received from GnuPG, but also how its command-line arguments are encoded. And that's not what we want. So I think the right fix is in epg--start: instead of setting :coding as part of the make-process call, it should call set-process-coding-system _after_ the make-process call, so that raw-text will affect only the text we send and receive from gpg. Can you try such a change and see if it fixes the problem?