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#65305: 29.1; archive-mode can not handle subfile names encoded with utf-8 Date: Tue, 15 Aug 2023 14:33:37 +0300 Message-ID: <83sf8ka6b2.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36261"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65305@debbugs.gnu.org To: awrhygty@outlook.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 15 13:34:26 2023 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 1qVsJd-0009CT-QW for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Aug 2023 13:34:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qVsJI-0007mp-Uw; Tue, 15 Aug 2023 07:34:04 -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 1qVsJG-0007mh-TK for bug-gnu-emacs@gnu.org; Tue, 15 Aug 2023 07:34: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 1qVsJG-0005uS-Ad for bug-gnu-emacs@gnu.org; Tue, 15 Aug 2023 07:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qVsJF-0005pn-OZ for bug-gnu-emacs@gnu.org; Tue, 15 Aug 2023 07:34:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Aug 2023 11:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65305 X-GNU-PR-Package: emacs Original-Received: via spool by 65305-submit@debbugs.gnu.org id=B65305.169209922322400 (code B ref 65305); Tue, 15 Aug 2023 11:34:01 +0000 Original-Received: (at 65305) by debbugs.gnu.org; 15 Aug 2023 11:33:43 +0000 Original-Received: from localhost ([127.0.0.1]:35098 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVsIx-0005pE-1O for submit@debbugs.gnu.org; Tue, 15 Aug 2023 07:33:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49208) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVsIu-0005p0-6n for 65305@debbugs.gnu.org; Tue, 15 Aug 2023 07:33:41 -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 1qVsIo-0005sF-F7; Tue, 15 Aug 2023 07:33:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=UKUAqeH3+xhx3ccpYxIgRQPl8jkvfmE/E5n2uZM9T2c=; b=fJxHqT8awt6xuMtVvZqG 9aoMKgfkLmY937OB24LAkfbdMp/kUxRdJljv2MjbrV0G0VGZl+O6vI5UWfoLNmG7zKSFH8fdBX4R9 BMAVfjmK637LoYWnodD3Q09uYyQdONsjsRHJ2qbyqHkNQVJTLiw1KIbLgISCZ3YvfOhCIkr51N7i5 kfGl5SFSqHtRuE6b2sG2UQ4oSS60zBLUG+W0l/TRupwV6I3KUaYM0b4HEFKCegxIj6lH2YxEFwUq8 del49h23CMqDxFuAAUMmgHAijCSnE9jwC2Ko3kDG41zIjQdMm9uuwgrGqaXs+jc7eoabx5VdWfiRl UWN+s7rFoqDLNg==; In-Reply-To: (awrhygty@outlook.com) 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:267479 Archived-At: > From: awrhygty@outlook.com > Date: Tue, 15 Aug 2023 13:31:16 +0900 > > > With python 3.10, ZIP archive can be created with: > python -m zipfile -c ARCHIVE.zip subfile > > If the subfile name contains non-ASCII characters, they are encoded with > utf-8 in anyway. Such subfile names are decoded with local language > encoding(cp932 for Japanese Windows OS) in archive-mode. > > For example, archive 一.txt in test.zip with python: > python -m zipfile -c test.zip 一.txt > The subfile name is shown as 荳\200.txt in archive-mode buffer and the > entry can not be extracted. Is there any way of distinguishing these Python-created ZIP archives from ZIP archives created by other Windows programs? Emacs by default assumes that file names in a ZIP archive created by a Windows program are encoded in the console codepage, and it enforces using that encoding for file names when the "creator" of the ZIP archive indicates the archive was created by Windows programs such as InfoZip's zip.exe and the File Explorer. In my testing, zip archives created by Python as above record the "creator" as number 0 (zero), which is identical to what InfoZip does. So, unless someone explains how to distinguish these zip archives from those created by InfoZip, I don't see how can Emacs know whether to use the InfoZip heuristics or the Python heuristics. Without the InfoZip/File Explorer heuristics we have in arc-mode.el today, Emacs on Windows would be completely unable to support non-ASCII file names in ZIP archives.