aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-09-30 17:13:10 +0200
committerLars Ingebrigtsen2019-09-30 17:13:10 +0200
commite7ee756f54834bda7ab2d862d7832a77de909b8e (patch)
tree5f9cf9176c8e170fe81facb19be0ed088d346eb7
parentab980bd7f5f9ec396ec84254bece6048f36ad8ff (diff)
downloademacs-e7ee756f54834bda7ab2d862d7832a77de909b8e.tar.gz
emacs-e7ee756f54834bda7ab2d862d7832a77de909b8e.zip
Fix problem with non-ASCII MML description strings
* lisp/gnus/mml.el (mml-insert-tag): Quote non-ASCII parameters. (mml-insert-mime-headers): Make it possible to have non-ASCII descriptions (bug#37555).
-rw-r--r--lisp/gnus/mml.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index 7fd78d7b9c1..5b31da2870c 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -923,11 +923,13 @@ type detected."
923 (unless (eq encoding '7bit) 923 (unless (eq encoding '7bit)
924 (insert (format "Content-Transfer-Encoding: %s\n" encoding))) 924 (insert (format "Content-Transfer-Encoding: %s\n" encoding)))
925 (when (setq description (cdr (assq 'description cont))) 925 (when (setq description (cdr (assq 'description cont)))
926 (insert "Content-Description: ") 926 (insert "Content-Description: "
927 (setq description (prog1 927 ;; The current buffer is unibyte, so do the description
928 (point) 928 ;; encoding in a temporary buffer.
929 (insert description "\n"))) 929 (with-temp-buffer
930 (mail-encode-encoded-word-region description (point))))) 930 (insert description "\n")
931 (mail-encode-encoded-word-region (point-min) (point-max))
932 (buffer-string))))))
931 933
932(defun mml-parameter-string (cont types) 934(defun mml-parameter-string (cont types)
933 (let ((string "") 935 (let ((string "")
@@ -1339,7 +1341,7 @@ If not set, `default-directory' will be used."
1339 (value (pop plist))) 1341 (value (pop plist)))
1340 (when value 1342 (when value
1341 ;; Quote VALUE if it contains suspicious characters. 1343 ;; Quote VALUE if it contains suspicious characters.
1342 (when (string-match "[\"'\\~/*;() \t\n]" value) 1344 (when (string-match "[\"'\\~/*;() \t\n[:multibyte:]]" value)
1343 (setq value (with-output-to-string 1345 (setq value (with-output-to-string
1344 (let (print-escape-nonascii) 1346 (let (print-escape-nonascii)
1345 (prin1 value))))) 1347 (prin1 value)))))