From: Basil L. Contovounesios Date: Thu, 5 Nov 2020 21:06:39 +0000 (+0000) Subject: Fix coding system in eww-display-pdf X-Git-Tag: emacs-28.0.90~5235 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4610241a9b3fbddd1f0973bf49f7008ed09ab955;p=emacs.git Fix coding system in eww-display-pdf * lisp/net/eww.el (eww-display-pdf): Make *eww pdf* buffer unibyte before populating it to avoid conversions. The binding for coding-system-for-write is then no longer necessary, and can be delegated to the viewer invoked by mailcap-view-mime. Suggested by Stefan Monnier . (Bug#44338) --- diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 340a913ceb8..43405fbd9c2 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -814,9 +814,9 @@ Currently this means either text/html or application/xhtml+xml." (let ((buf (current-buffer)) (pos (point))) (with-current-buffer (get-buffer-create "*eww pdf*") - (let ((coding-system-for-write 'raw-text-unix) - (inhibit-read-only t)) + (let ((inhibit-read-only t)) (erase-buffer) + (set-buffer-multibyte nil) (insert-buffer-substring buf pos) (mailcap-view-mime "application/pdf")) (if (zerop (buffer-size))