From d63f1b3114a53e1e5d972bde3c13d2234bcd79c6 Mon Sep 17 00:00:00 2001 From: Jean Schurger Date: Tue, 3 Feb 2015 15:44:21 -0500 Subject: [PATCH] mu4e: Used temporary file instead of region to call the html renderer. (fix encoding issues) --- mu4e/mu4e-message.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mu4e/mu4e-message.el b/mu4e/mu4e-message.el index 587a5183..0b40f1ce 100644 --- a/mu4e/mu4e-message.el +++ b/mu4e/mu4e-message.el @@ -178,8 +178,11 @@ be changed by setting `mu4e-view-prefer-html'." (insert html) (cond ((stringp mu4e-html2text-command) - (shell-command-on-region (point-min) (point-max) - mu4e-html2text-command nil t)) + (let* ((tmp-file (make-temp-file "mu4e-html"))) + (write-region (point-min) (point-max) tmp-file) + (mu4e-process-file-through-pipe tmp-file mu4e-html2text-command)) + (delete-file tmp-file) + ) ((functionp mu4e-html2text-command) (funcall mu4e-html2text-command)) (t (mu4e-error "Invalid `mu4e-html2text-command'")))