From: Eli Zaretskii Date: Fri, 2 Mar 2018 08:44:44 +0000 (+0200) Subject: Fix downloading non-text files in EWW X-Git-Tag: emacs-26.1-rc1~136 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=04da8f4c292bf9cd666f883181afd1de32d0f67f;p=emacs.git Fix downloading non-text files in EWW * lisp/net/eww.el (eww-download-callback): Bind coding-system-for-read to 'no-conversion', to avoid any code- or EOL-conversions in downloaded files. (Bug#30664) --- diff --git a/lisp/net/eww.el b/lisp/net/eww.el index caac96a4859..66b1767b563 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1532,7 +1532,8 @@ Differences in #targets are ignored." eww-download-directory))) (goto-char (point-min)) (re-search-forward "\r?\n\r?\n") - (write-region (point) (point-max) file) + (let ((coding-system-for-write 'no-conversion)) + (write-region (point) (point-max) file)) (message "Saved %s" file)))) (defun eww-decode-url-file-name (string)