* bug#35265: 26.1; gnus-icalendar: charset detection
@ 2019-04-14 9:32 Christophe TROESTLER
2019-04-14 12:41 ` Robert Pluim
0 siblings, 1 reply; 4+ messages in thread
From: Christophe TROESTLER @ 2019-04-14 9:32 UTC (permalink / raw)
To: 35265
Ical invitations sent by Google use a content type such as
Content-Type: text/calendar; charset="UTF-8"; method=REQUEST
The problem is that the charset is not properly understood by gnus-icalendar because it is capitalized. The following “downcase” in the definition of “gnus-icalendar-with-decoded-handle” fixes the problem:
(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)))))
(with-temp-buffer
(mm-insert-part ,handle)
(when (string= (downcase ,charset) "utf-8")
(decode-coding-region (point-min) (point-max) 'utf-8))
,@body))))
Best,
C.
In GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.4)
of 2019-02-03, modified by Debian built on zam904
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description: Debian GNU/Linux buster/sid
Recent messages:
Mark saved where search started
gnus-icalendar-event-from-handle
Undo! [4 times]
gnus-icalendar-with-decoded-handle
Entering debugger...
Back to top level
gnus-icalendar-with-decoded-handle
gnus-icalendar-event-from-handle
[mu4e] Found 500 matching messages
Making completion list... [2 times]
Configured using:
'configure --build x86_64-linux-gnu --prefix=/usr
--sharedstatedir=/var/lib --libexecdir=/usr/lib
--localstatedir=/var/lib --infodir=/usr/share/info
--mandir=/usr/share/man --enable-libsystemd --with-pop=yes
--enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp
--with-sound=alsa --without-gconf --with-mailutils --build
x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
--libexecdir=/usr/lib --localstatedir=/var/lib
--infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd
--with-pop=yes
--enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp
--with-sound=alsa --without-gconf --with-mailutils --with-x=yes
--with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2
-fdebug-prefix-map=/build/emacs-26.1+1=. -fstack-protector-strong
-Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
-D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro'
Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LIBSYSTEMD LCMS2
Important settings:
value of $LC_MESSAGES: en_US.UTF-8
value of $LC_NUMERIC: en_US.UTF-8
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: mu4e:view
Minor modes in effect:
visual-fill-column-mode: t
TeX-PDF-mode: t
global-magit-file-mode: t
diff-auto-refine-mode: t
magit-auto-revert-mode: t
global-git-commit-mode: t
async-bytecomp-package-mode: t
shell-dirtrack-mode: t
desktop-save-mode: t
show-paren-mode: t
global-edit-server-edit-mode: t
tooltip-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
buffer-read-only: t
column-number-mode: t
line-number-mode: t
visual-line-mode: t
transient-mark-mode: t
Load-path shadows:
~/software/OCaml/dune/editor-integration/emacs/dune-flymake hides /home/trch/.opam/4.06.1/share/emacs/site-lisp/dune-flymake
~/software/OCaml/dune/editor-integration/emacs/dune hides /home/trch/.opam/4.06.1/share/emacs/site-lisp/dune
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/deb-view hides /usr/share/emacs/site-lisp/elpa/debian-el-37/deb-view
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/debian-bug hides /usr/share/emacs/site-lisp/elpa/debian-el-37/debian-bug
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/apt-utils hides /usr/share/emacs/site-lisp/elpa/debian-el-37/apt-utils
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/preseed hides /usr/share/emacs/site-lisp/elpa/debian-el-37/preseed
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/apt-sources hides /usr/share/emacs/site-lisp/elpa/debian-el-37/apt-sources
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/debian-autoloads hides /usr/share/emacs/site-lisp/elpa/debian-el-37/debian-autoloads
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/debian-el hides /usr/share/emacs/site-lisp/elpa/debian-el-37/debian-el
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/debian-el-autoloads hides /usr/share/emacs/site-lisp/elpa/debian-el-37/debian-el-autoloads
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/gnus-BTS hides /usr/share/emacs/site-lisp/elpa/debian-el-37/gnus-BTS
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/debian-el-pkg hides /usr/share/emacs/site-lisp/elpa/debian-el-37/debian-el-pkg
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/deb-view hides /usr/share/emacs/site-lisp/elpa-src/debian-el-37/deb-view
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/apt-utils hides /usr/share/emacs/site-lisp/elpa-src/debian-el-37/apt-utils
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/preseed hides /usr/share/emacs/site-lisp/elpa-src/debian-el-37/preseed
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/debian-bug hides /usr/share/emacs/site-lisp/elpa-src/debian-el-37/debian-bug
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/apt-sources hides /usr/share/emacs/site-lisp/elpa-src/debian-el-37/apt-sources
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/debian-autoloads hides /usr/share/emacs/site-lisp/elpa-src/debian-el-37/debian-autoloads
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/debian-el hides /usr/share/emacs/site-lisp/elpa-src/debian-el-37/debian-el
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/debian-el-autoloads hides /usr/share/emacs/site-lisp/elpa-src/debian-el-37/debian-el-autoloads
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/gnus-BTS hides /usr/share/emacs/site-lisp/elpa-src/debian-el-37/gnus-BTS
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/debian-el-pkg hides /usr/share/emacs/site-lisp/elpa-src/debian-el-37/debian-el-pkg
Features:
(shadow face-remap emacsbug cl-print debug map eieio-opt deuglify
gnus-async gnus-cus gnus-demon gnus-diary nndiary gnus-draft gnus-agent
nnvirtual nntp gnus-cache nndraft nnmh gnus-dup gnus-fun gnus-html
url-queue url-cache mm-url url url-proxy url-privacy url-expand
url-methods url-history url-cookie url-domsuf gnus-kill gnus-logic
gnus-mh mh-comp mh-scan mh-gnus mh-e mh-compat mh-buffers mh-loaddefs
gnus-registry registry eieio-base gnus-salt gnus-score score-mode
gnus-srvr gnus-topic gnus-uu yenc gnus-vm gnus-msg help-fns radix-tree
misearch multi-isearch tabify man sh-script executable shr-color color
url-util shr svg dom smiley gnus-cite visual-fill-column sort mm-archive
mail-extr qp latexenc reftex-auc preview prv-emacs tex-buf reftex-dcr
reftex reftex-loaddefs reftex-vars latex latex-flymake tex-ispell
tex-style tex-mode org-rmail org-mhe org-irc org-info org-gnus nnir
org-docview org-bibtex org-bbdb org-w3m conf-mode elec-pair vc-git
flyspell ispell tuareg caml-help find-file font-latex tex dbus xml
bibtex dune-flymake flymake-proc flymake compile warnings dune skeleton
smie utop utop-minor-mode pcase merlin-cap merlin caml-types caml-emacs
magit-submodule magit-obsolete magit-blame magit-stash magit-bisect
magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit
magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff
smerge-mode diff-mode magit-core magit-autorevert magit-margin
magit-transient magit-process magit-mode transient git-commit magit-git
magit-section magit-utils crm log-edit pcvs-util add-log with-editor
cl-extra async-bytecomp async shell subr-x dash erc-goodies erc
erc-backend erc-compat pp org-mu4e mu4e-icalendar gnus-icalendar
org-capture mu4e-contrib mu4e desktop frameset mu4e-speedbar speedbar
sb-image ezimage dframe mu4e-main mu4e-view thingatpt browse-url
gnus-art mm-uu mml2015 mm-view mml-smime smime dig mailcap gnus-sum
gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source tls
gnutls utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range gnus-win
gnus nnheader wid-edit mu4e-headers mu4e-compose mu4e-context mu4e-draft
mu4e-actions ido rfc2368 smtpmail sendmail mu4e-mark mu4e-message
flow-fill mu4e-proc mu4e-utils doc-view jka-compr image-mode mu4e-lists
mu4e-vars message rmc puny dired dired-loaddefs rfc822 mml mml-sec
gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev mail-utils gmm-utils
mailheader hl-line mu4e-meta adoc-mode tempo markup-faces org-element
avl-tree generator org org-macro org-footnote org-pcomplete pcomplete
org-list org-faces org-entities noutline outline easy-mmode org-version
ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp
ob-comint comint ansi-color ring ob-core ob-eval org-compat org-macs
org-loaddefs format-spec find-func epa-file epa derived epg cl quail
help-mode mm-util mail-prsvr autorevert filenotify edmacro kmacro paren
icalendar diary-lib diary-loaddefs cal-menu calendar cal-loaddefs
edit-server advice server finder-inf rx tex-site debian-el gh-common
marshal eieio-compat info package easymenu epg-config url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv
cl-loaddefs cl-lib time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)
Memory information:
((conses 16 778170 69835)
(symbols 48 61234 1)
(miscs 40 3700 1605)
(strings 32 224130 20925)
(string-bytes 1 6859358)
(vectors 16 79590)
(vector-slots 8 2259074 188898)
(floats 8 640 460)
(intervals 56 48293 3620)
(buffers 992 197))
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#35265: 26.1; gnus-icalendar: charset detection
2019-04-14 9:32 bug#35265: 26.1; gnus-icalendar: charset detection Christophe TROESTLER
@ 2019-04-14 12:41 ` Robert Pluim
2019-04-14 14:21 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Robert Pluim @ 2019-04-14 12:41 UTC (permalink / raw)
To: Christophe TROESTLER; +Cc: 35265
[-- Attachment #1: Type: text/plain, Size: 664 bytes --]
>>>>> On Sun, 14 Apr 2019 09:32:32 +0000, Christophe TROESTLER <Christophe.TROESTLER@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?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Downcase-charset.patch --]
[-- Type: text/x-patch, Size: 1111 bytes --]
From 009929e3bb10692bd5ac10e4f1613cc6065a21e7 Mon Sep 17 00:00:00 2001
From: Robert Pluim <rpluim@gmail.com>
Date: Sun, 14 Apr 2019 14:36:30 +0200
Subject: [PATCH] Downcase charset
To: emacs-devel@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@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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#35265: 26.1; gnus-icalendar: charset detection
2019-04-14 12:41 ` Robert Pluim
@ 2019-04-14 14:21 ` Eli Zaretskii
2019-04-14 17:44 ` Robert Pluim
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2019-04-14 14:21 UTC (permalink / raw)
To: Robert Pluim; +Cc: Christophe.TROESTLER, 35265
> From: Robert Pluim <rpluim@gmail.com>
> Date: Sun, 14 Apr 2019 14:41:25 +0200
> Cc: 35265@debbugs.gnu.org
>
> Looks obviously correct. Eli, can I put this in emacs-26?
OK, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#35265: 26.1; gnus-icalendar: charset detection
2019-04-14 14:21 ` Eli Zaretskii
@ 2019-04-14 17:44 ` Robert Pluim
0 siblings, 0 replies; 4+ messages in thread
From: Robert Pluim @ 2019-04-14 17:44 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Christophe.TROESTLER, 35265
tags 35265 fixed
close 35265 26.3
quit
>>>>> On Sun, 14 Apr 2019 17:21:54 +0300, Eli Zaretskii <eliz@gnu.org> said:
>> From: Robert Pluim <rpluim@gmail.com> Date: Sun, 14 Apr 2019
>> 14:41:25 +0200 Cc: 35265@debbugs.gnu.org
>>
>> Looks obviously correct. Eli, can I put this in emacs-26?
Eli> OK, thanks.
Closing.
Committed as 266c62290f
Robert
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-04-14 17:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-14 9:32 bug#35265: 26.1; gnus-icalendar: charset detection Christophe TROESTLER
2019-04-14 12:41 ` Robert Pluim
2019-04-14 14:21 ` Eli Zaretskii
2019-04-14 17:44 ` Robert Pluim
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.