mu4e: explicitly specify utf8 for html-view actions

Explicitly add the (html 5) <meta charset ...> for UTF-8; not all
browsers default to UTF-8 and could show the class "Â" characters when
interpreting UTF-8 as ISO-8859-1.
This commit is contained in:
djcb 2016-01-31 12:48:12 +02:00
parent 0087440a19
commit 29a4ae1c83
1 changed files with 2 additions and 0 deletions

View File

@ -84,6 +84,7 @@ You can influence the browser to use with the variable
(mu4e-error "No body part for this message"))
(with-temp-buffer
;; simplistic -- but note that it's only an example...
(insert "<head><meta charset=\"UTF-8\"></head>\n")
(insert (or html (concat "<pre>" txt "</pre>")))
(write-file tmpfile)
(browse-url (concat "file://" tmpfile)))))
@ -104,6 +105,7 @@ You can influence the browser to use with the variable
(mu4e-error "No body part for this message"))
(with-temp-buffer
;; simplistic -- but note that it's only an example...
(insert "<head><meta charset=\"UTF-8\"></head>\n")
(insert (or html (concat "<pre>" txt "</pre>")))
(write-file tmpfile)
(xwidget-webkit-browse-url (concat "file://" tmpfile) t))))