mirror of https://github.com/djcb/mu.git
* mu4e-utils: cleanup some outlook encoding garbage
This commit is contained in:
parent
b16aab5b3d
commit
7816436b2a
|
@ -372,8 +372,19 @@ function prefers the text part, but this can be changed by setting
|
|||
(buffer-string)))
|
||||
(t ;; otherwise, an empty body
|
||||
""))))
|
||||
;; and finally, remove some crap from the remaining string.
|
||||
(replace-regexp-in-string "[
]" " " body nil nil nil)))
|
||||
;; and finally, remove some crap from the remaining string; it seems
|
||||
;; esp. outlook lies about its encoding (ie., it says 'iso-8859-1' but
|
||||
;; really it's 'windows-1252'), thus giving us these funky chars. here, we
|
||||
;; either remove them, or replace with 'what-was-meant' (heuristically)
|
||||
(with-temp-buffer
|
||||
(insert body)
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "[
]" nil t)
|
||||
(replace-match
|
||||
(cond
|
||||
((string= (match-string 0) "") "'")
|
||||
(t ""))))
|
||||
(buffer-string))))
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue