From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: determining process coding Date: Thu, 12 Feb 2015 18:24:16 +0800 Message-ID: <87egpv5sxb.fsf@ericabrahamsen.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1423736702 5585 80.91.229.3 (12 Feb 2015 10:25:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Feb 2015 10:25:02 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 12 11:24:55 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YLqx1-0006Ce-H2 for geh-help-gnu-emacs@m.gmane.org; Thu, 12 Feb 2015 11:24:51 +0100 Original-Received: from localhost ([::1]:49433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLqx0-0004rn-IO for geh-help-gnu-emacs@m.gmane.org; Thu, 12 Feb 2015 05:24:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLqwo-0004ql-VN for help-gnu-emacs@gnu.org; Thu, 12 Feb 2015 05:24:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLqwk-0005fF-6I for help-gnu-emacs@gnu.org; Thu, 12 Feb 2015 05:24:38 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:42472) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLqwj-0005f6-VW for help-gnu-emacs@gnu.org; Thu, 12 Feb 2015 05:24:34 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YLqwi-00060O-0e for help-gnu-emacs@gnu.org; Thu, 12 Feb 2015 11:24:32 +0100 Original-Received: from 111.199.144.192 ([111.199.144.192]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Feb 2015 11:24:31 +0100 Original-Received: from eric by 111.199.144.192 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Feb 2015 11:24:31 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 36 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 111.199.144.192 User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:401B7NJvPPk4Cavt6Viz8ETLZgc= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:102669 Archived-At: I've been trying for a while to improve Gnus' ability to search for multibyte strings on IMAP servers, by sending in a charset and a string literal as part of the SEARCH command. So instead of this: . UID SEARCH SUBJECT "metal band" we can send this: . UID SEARCH CHARSET UTF-8 SUBJECT {10+} Motörhead The details aren't terribly interesting, basically you specify a charset, and the number of string bytes in brackets, then send the string itself on a separate line. I'm having two problems: 1) I don't really know how to determine the proper charset to use, and 2) some IMAP servers (*cough* exchange *cough*) don't accept many charsets, including utf-8. Number 2 can only be worked around, but number 1 should be resolvable. Gnus opens a long-running connection to an IMAP server through a process buffer, and while playing with the code, I tried (process-coding-system (get-buffer-process (current-buffer))) while the IMAP buffer was current, and it gave me (binary . binary). I'm not sure what to do with that information. Searching this very server using utf-8 works just fine, so I'm assuming that I'm coming to some sort of fallback value. Can anyone tell me how to reliably tell what coding system Gnus will use to send strings (with `process-send-string') to the IMAP server? Bonus points for any wisdom regarding dealing with IMAP servers that don't accept UTF-8. Thanks for any pointers, Eric