From 25f45d710e91a7c1049f056ff27bc3e6968f5624 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 1 Oct 2019 21:51:23 +0200 Subject: [PATCH] Avoid bugging out on multibyte SVG data in shr * lisp/net/shr.el (svg--wrap-svg): Ensure that the SVG data is unibyte. --- lisp/net/shr.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/net/shr.el b/lisp/net/shr.el index dc3cc38c798..ef236bf7c48 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1199,7 +1199,9 @@ Return a string with image data." " " (face-foreground 'default) (car size) (cdr size) - (base64-encode-string data t))) + (base64-encode-string (encode-coding-string + data (car (detect-coding-string data))) + t))) (buffer-string)))) (defun shr-image-displayer (content-function) -- 2.39.5