[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master e7ee756: Fix problem with non-ASCII MML description
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master e7ee756: Fix problem with non-ASCII MML description strings |
Date: |
Mon, 30 Sep 2019 11:15:16 -0400 (EDT) |
branch: master
commit e7ee756f54834bda7ab2d862d7832a77de909b8e
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
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).
---
lisp/gnus/mml.el | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index 7fd78d7..5b31da2 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -923,11 +923,13 @@ type detected."
(unless (eq encoding '7bit)
(insert (format "Content-Transfer-Encoding: %s\n" encoding)))
(when (setq description (cdr (assq 'description cont)))
- (insert "Content-Description: ")
- (setq description (prog1
- (point)
- (insert description "\n")))
- (mail-encode-encoded-word-region description (point)))))
+ (insert "Content-Description: "
+ ;; The current buffer is unibyte, so do the description
+ ;; encoding in a temporary buffer.
+ (with-temp-buffer
+ (insert description "\n")
+ (mail-encode-encoded-word-region (point-min) (point-max))
+ (buffer-string))))))
(defun mml-parameter-string (cont types)
(let ((string "")
@@ -1339,7 +1341,7 @@ If not set, `default-directory' will be used."
(value (pop plist)))
(when value
;; Quote VALUE if it contains suspicious characters.
- (when (string-match "[\"'\\~/*;() \t\n]" value)
+ (when (string-match "[\"'\\~/*;() \t\n[:multibyte:]]" value)
(setq value (with-output-to-string
(let (print-escape-nonascii)
(prin1 value)))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master e7ee756: Fix problem with non-ASCII MML description strings,
Lars Ingebrigtsen <=