GNU bug report logs - #65305
29.1; archive-mode can not handle subfile names encoded with utf-8

Previous Next

Package: emacs;

Reported by: awrhygty <at> outlook.com

Date: Tue, 15 Aug 2023 04:32:02 UTC

Severity: normal

Found in version 29.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 65305 <at> debbugs.gnu.org (full text, mbox):

From: awrhygty <at> outlook.com
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 65305 <at> debbugs.gnu.org
Subject: Re: bug#65305: 29.1; archive-mode can not handle subfile names
 encoded with utf-8
Date: Thu, 17 Aug 2023 22:56:54 +0900
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: awrhygty <at> outlook.com
>> Cc: 65305 <at> debbugs.gnu.org
>> Date: Wed, 16 Aug 2023 12:47:14 +0900
>> 
>> Eli Zaretskii <eliz <at> 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.

[archive-utf.el (application/emacs-lisp, inline)]

This bug report was last modified 1 year and 275 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.