help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

determining process coding


From: Eric Abrahamsen
Subject: determining process coding
Date: Thu, 12 Feb 2015 18:24:16 +0800
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]