From: Eli Zaretskii <eliz@gnu.org>
To: awrhygty@outlook.com
Cc: 65305@debbugs.gnu.org
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 [thread overview]
Message-ID: <83sf8ka6b2.fsf@gnu.org> (raw)
In-Reply-To: <TYZPR01MB3920D839D9B919707BD2D8DCC314A@TYZPR01MB3920.apcprd01.prod.exchangelabs.com> (awrhygty@outlook.com)
> 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.
next prev parent reply other threads:[~2023-08-15 11:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-15 4:31 bug#65305: 29.1; archive-mode can not handle subfile names encoded with utf-8 awrhygty
2023-08-15 11:33 ` Eli Zaretskii [this message]
2023-08-15 13:53 ` awrhygty
2023-08-15 14:50 ` Eli Zaretskii
2023-08-16 3:47 ` awrhygty
2023-08-16 12:38 ` Eli Zaretskii
2023-08-17 13:56 ` awrhygty
2023-08-17 14:19 ` Eli Zaretskii
2023-08-24 6:18 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83sf8ka6b2.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=65305@debbugs.gnu.org \
--cc=awrhygty@outlook.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.