GNU bug report logs - #35265
26.1; gnus-icalendar: charset detection

Previous Next

Package: emacs;

Reported by: Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be>

Date: Sun, 14 Apr 2019 09:33:02 UTC

Severity: normal

Tags: fixed

Found in version 26.1

Fixed in version 26.3

Done: Robert Pluim <rpluim <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 35265 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be>
Cc: 35265 <at> debbugs.gnu.org
Subject: Re: bug#35265: 26.1; gnus-icalendar: charset detection
Date: Sun, 14 Apr 2019 14:41:25 +0200
[Message part 1 (text/plain, inline)]
>>>>> On Sun, 14 Apr 2019 09:32:32 +0000, Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be> said:

    Christophe> Ical invitations sent by Google use a content type
    Christophe> such as

    Christophe>   Content-Type: text/calendar; charset="UTF-8";
    Christophe> method=REQUEST

    Christophe> The problem is that the charset is not properly
    Christophe> understood by gnus-icalendar because it is
    Christophe> capitalized.  The following “downcase” in the
    Christophe> definition of “gnus-icalendar-with-decoded-handle”
    Christophe> fixes the problem:

Looks obviously correct. Eli, can I put this in emacs-26?

[0001-Downcase-charset.patch (text/x-patch, inline)]
From 009929e3bb10692bd5ac10e4f1613cc6065a21e7 Mon Sep 17 00:00:00 2001
From: Robert Pluim <rpluim <at> gmail.com>
Date: Sun, 14 Apr 2019 14:36:30 +0200
Subject: [PATCH] Downcase charset
To: emacs-devel <at> gnu.org

RFC 2046 specifies that the charset parameter is case-insensitive.

* lisp/gnus/gnus-icalendar.el (gnus-icalendar-with-decoded-handle):
Downcase charset.  Suggested by Christophe TROESTLER
<Christophe.TROESTLER <at> umons.ac.be>.  (Bug#35265).
---
 lisp/gnus/gnus-icalendar.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el
index f79ce36843..e4ad2af063 100644
--- a/lisp/gnus/gnus-icalendar.el
+++ b/lisp/gnus/gnus-icalendar.el
@@ -767,7 +767,7 @@ gnus-icalendar-with-decoded-handle
     `(let ((,charset (cdr (assoc 'charset (mm-handle-type ,handle)))))
        (with-temp-buffer
          (mm-insert-part ,handle)
-         (when (string= ,charset "utf-8")
+         (when (string= (downcase ,charset) "utf-8")
            (decode-coding-region (point-min) (point-max) 'utf-8))
          ,@body))))
 
-- 
2.21.0.196.g041f5ea1cf


This bug report was last modified 6 years and 33 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.