From 4803f97204773180d6ea97868a7d1859141e9ab5 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 11 Mar 2023 11:54:31 +0200 Subject: [PATCH] Fix copying binary files from zip archives * lisp/arc-mode.el (archive-copy-file): Prevent any coding conversions when writing output files. (Bug#62091) --- lisp/arc-mode.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index 6f3e922880d..dcf7c17a878 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -1093,7 +1093,9 @@ NEW-NAME." (with-temp-buffer (set-buffer-multibyte nil) (archive--extract-file extractor copy ename) - (write-region (point-min) (point-max) write-to)) + (let ((coding-system-for-write + (or coding-system-for-write 'no-conversion))) + (write-region (point-min) (point-max) write-to))) (unless (equal copy archive) (delete-file copy)))))))) -- 2.39.2