summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-icalendar.el
diff options
context:
space:
mode:
authorJae-hyeon Park <jhpark@kias.re.kr>2022-01-29 15:44:44 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2022-01-29 15:44:44 +0100
commit852a5f24bb28a5d814a9515faa525c5bd5ab1c71 (patch)
tree619348c09faac472b1e2df141f3b7ac95e78c487 /lisp/gnus/gnus-icalendar.el
parent4bac7d8c73440be88eaf07a6da54feb7eaaf2503 (diff)
downloademacs-852a5f24bb28a5d814a9515faa525c5bd5ab1c71.tar.gz
emacs-852a5f24bb28a5d814a9515faa525c5bd5ab1c71.tar.bz2
emacs-852a5f24bb28a5d814a9515faa525c5bd5ab1c71.zip
Make gnus-icalendar-with-decoded-handle more DWIM
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-with-decoded-handle): Assume that calendars with no charset is utf-8. Copyright-paperwork-exempt: yes
Diffstat (limited to 'lisp/gnus/gnus-icalendar.el')
-rw-r--r--lisp/gnus/gnus-icalendar.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el
index 754a1d91cb5..1bffdf3513a 100644
--- a/lisp/gnus/gnus-icalendar.el
+++ b/lisp/gnus/gnus-icalendar.el
@@ -830,11 +830,12 @@ These will be used to retrieve the RSVP information from ical events."
(defmacro gnus-icalendar-with-decoded-handle (handle &rest body)
"Execute BODY in buffer containing the decoded contents of HANDLE."
(let ((charset (make-symbol "charset")))
- `(let ((,charset (cdr (assoc 'charset (mm-handle-type ,handle)))))
+ `(let ((,charset (downcase
+ (or (cdr (assoc 'charset (mm-handle-type ,handle)))
+ "utf-8"))))
(with-temp-buffer
(mm-insert-part ,handle)
- (when (and ,charset (string= (downcase ,charset) "utf-8"))
- (decode-coding-region (point-min) (point-max) 'utf-8))
+ (decode-coding-region (point-min) (point-max) (intern ,charset))
,@body))))