From: Eric Abrahamsen Date: Mon, 25 Oct 2021 16:39:52 +0000 (-0700) Subject: IMAP search should only use charset utf-8 with multibyte strings X-Git-Tag: emacs-29.0.90~3671^2~412 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e73b8ae86f09b34a65086641d693aea78e42fb25;p=emacs.git IMAP search should only use charset utf-8 with multibyte strings Background: Exchange servers cannot accept "charset utf-8" search strings. The code originally set that charset for any server with literal+ capability, borking all searches on an Exchange server. This code only sets utf-8 for multibyte search strings in particular, which would be borken for Exchange anyway. * lisp/gnus/gnus-search.el (gnus-search-imap-search-command): Ensure we're only doing the literal+ dance for multibyte strings (multibyte strings will have had newlines inserted in an earlier step). --- diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 9c83d5fa376..31573588046 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -1084,7 +1084,8 @@ Responsible for handling and, or, and parenthetical expressions.") Currently takes into account support for the LITERAL+ capability. Other capabilities could be tested here." (with-slots (literal-plus) engine - (when literal-plus + (when (and literal-plus + (string-match-p "\n" query)) (setq query (split-string query "\n"))) (cond ((consp query)