diff options
| author | Eli Zaretskii | 2023-08-16 15:34:09 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2023-08-16 15:34:09 +0300 |
| commit | 205d87cdca09c648da4fc8ec622c135e1655a08b (patch) | |
| tree | d0c66f238ca5d03f811faf9d33da604ae0d0fea1 | |
| parent | 3712e8bc385e05520b4f410abd4f627ac668c65d (diff) | |
| download | emacs-205d87cdca09c648da4fc8ec622c135e1655a08b.tar.gz emacs-205d87cdca09c648da4fc8ec622c135e1655a08b.zip | |
Fix unpacking ZIP archives on MS-Windows
* lisp/arc-mode.el (archive-zip-summarize): Decode file names as
UTF-8 when bit 11 of flags is set, even on MS-Windows.
(Bug#65305)
| -rw-r--r-- | lisp/arc-mode.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index 5e696c091b2..05a71fb4c5a 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el | |||
| @@ -1990,6 +1990,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." | |||
| 1990 | (setq p (+ p (point-min))) | 1990 | (setq p (+ p (point-min))) |
| 1991 | (while (string= "PK\001\002" (buffer-substring p (+ p 4))) | 1991 | (while (string= "PK\001\002" (buffer-substring p (+ p 4))) |
| 1992 | (let* ((creator (get-byte (+ p 5))) | 1992 | (let* ((creator (get-byte (+ p 5))) |
| 1993 | (gpflags (archive-l-e (+ p 8) 2)) | ||
| 1993 | ;; (method (archive-l-e (+ p 10) 2)) | 1994 | ;; (method (archive-l-e (+ p 10) 2)) |
| 1994 | (modtime (archive-l-e (+ p 12) 2)) | 1995 | (modtime (archive-l-e (+ p 12) 2)) |
| 1995 | (moddate (archive-l-e (+ p 14) 2)) | 1996 | (moddate (archive-l-e (+ p 14) 2)) |
| @@ -2001,7 +2002,12 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." | |||
| 2001 | (efnname (let ((str (buffer-substring (+ p 46) (+ p 46 fnlen)))) | 2002 | (efnname (let ((str (buffer-substring (+ p 46) (+ p 46 fnlen)))) |
| 2002 | (decode-coding-string | 2003 | (decode-coding-string |
| 2003 | str | 2004 | str |
| 2004 | (or (if (and w32-fname-encoding | 2005 | ;; Bit 11 of general purpose bit flags (bytes |
| 2006 | ;; 8-9) of Central Directory: 1 means UTF-8 | ||
| 2007 | ;; encoded file names. | ||
| 2008 | (or (if (/= 0 (logand gpflags #x0800)) | ||
| 2009 | 'utf-8-unix) | ||
| 2010 | (if (and w32-fname-encoding | ||
| 2005 | (memq creator | 2011 | (memq creator |
| 2006 | ;; This should be just 10 and | 2012 | ;; This should be just 10 and |
| 2007 | ;; 14, but InfoZip uses 0 and | 2013 | ;; 14, but InfoZip uses 0 and |