From 4610241a9b3fbddd1f0973bf49f7008ed09ab955 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Thu, 5 Nov 2020 21:06:39 +0000 Subject: [PATCH] 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) --- lisp/net/eww.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)) -- 2.39.2