From: Lars Ingebrigtsen Date: Tue, 1 Oct 2019 19:51:23 +0000 (+0200) Subject: Avoid bugging out on multibyte SVG data in shr X-Git-Tag: emacs-27.0.90~1329 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=25f45d710e91a7c1049f056ff27bc3e6968f5624;p=emacs.git Avoid bugging out on multibyte SVG data in shr * lisp/net/shr.el (svg--wrap-svg): Ensure that the SVG data is unibyte. --- 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)