From: awrhygty@outlook.com
To: Eli Zaretskii <eliz@gnu.org>
Cc: 65305@debbugs.gnu.org
Subject: bug#65305: 29.1; archive-mode can not handle subfile names encoded with utf-8
Date: Thu, 17 Aug 2023 22:56:54 +0900 [thread overview]
Message-ID: <TYZPR01MB3920773E523D734041C4274BC31AA@TYZPR01MB3920.apcprd01.prod.exchangelabs.com> (raw)
In-Reply-To: <83h6oz88n0.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 16 Aug 2023 08:38:27 -0400")
[-- Attachment #1: Type: text/plain, Size: 2383 bytes --]
Eli Zaretskii <eliz@gnu.org> writes:
>> From: awrhygty@outlook.com
>> Cc: 65305@debbugs.gnu.org
>> Date: Wed, 16 Aug 2023 12:47:14 +0900
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> >> There is a bit flag indicating that the subfile name is encoded with
>> >> utf-8. Bytes 6-7 in local file header or bytes 8-9 in central directory
>> >> header are general purpose bit flag. And bit 11 of the flag represents
>> >> file encoding flag(1 for utf-8 encoding).
>> >
>> > Thanks, please try the patch below. If it gives good results, I will
>> > install it.
>>
>> The patch works to list entries, and the contents can be extracted with
>> 7z.exe. unzip.exe does not work well.
>
> Thanks, I installed the patch on the emacs-29 branch. I'm not
> surprised that unzip.exe cannot extract such files, and I think it
> works for you with 7z.exe by sheer luck: Windows transparently
> converts non-ASCII characters to the system codepage when it invokes
> programs via the "narrow" APIs, so it could mangle the UTF-8 encoded
> file name into something unrecognizable.
>
>> I tried the settings below, but rewriting entries does not work.
>> (archive-zip-* variables' values are default if archive-7z-program is set
>> and zip.exe/unzip.exe are non-existent)
>>
>> (setq archive-7z-program "c:/Program Files/7-Zip/7z.exe"
>> archive-zip-extract '("c:/Program Files/7-Zip/7z.exe" "x" "-so")
>> archive-zip-expunge '("c:/Program Files/7-Zip/7z.exe" "d")
>> archive-zip-update '("c:/Program Files/7-Zip/7z.exe" "u")
>> archive-zip-update-case archive-zip-update)
>>
>> It is because update command needs "-si" option followed by an entry
>> name. It should be one argument like (format "-si%s" name).
>
> Sorry, I don't understand: is this the same problem, or is this an
> additional problem? For example, does rewriting entries work with
> ASCII file names?
>
> If this is a separate problem, I prefer that you submit a separate bug
> report with all the pertinent details.
>
> Thanks.
Sorry, I have mistaken something.
7z.exe works for rewriting with the settings above.
(not only ascii subfiles but also cp932 encodable subfiles)
I imagine if there is a special program which interprets ascii arguments
into multilingual strings.
Any subfile in any archive file will be treated correctly within emacs.
So I implemented an instant program using base64.
[-- Attachment #2: archive-utf.el --]
[-- Type: application/emacs-lisp, Size: 2940 bytes --]
next prev parent reply other threads:[~2023-08-17 13:56 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
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 [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=TYZPR01MB3920773E523D734041C4274BC31AA@TYZPR01MB3920.apcprd01.prod.exchangelabs.com \
--to=awrhygty@outlook.com \
--cc=65305@debbugs.gnu.org \
--cc=eliz@gnu.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).