* [PATCH] (nnir-run-imap): try UTF-8 search first and go with US-ASCII if it doesn't work out.
@ 2011-02-27 21:31 Gergely Risko
2011-03-05 11:33 ` Lars Magne Ingebrigtsen
0 siblings, 1 reply; 5+ messages in thread
From: Gergely Risko @ 2011-02-27 21:31 UTC (permalink / raw)
To: ding
diff --git a/lisp/nnir.el b/lisp/nnir.el
index eaaac3f..e6e10c6 100644
--- a/lisp/nnir.el
+++ b/lisp/nnir.el
@@ -796,11 +796,19 @@ details on the language and supported extensions"
(with-current-buffer (nnimap-buffer)
(message "Searching %s..." group)
(let ((arts 0)
- (result (nnimap-command "UID SEARCH %s"
- (if (string= criteria "")
- qstring
- (nnir-imap-make-query
- criteria qstring)))))
+ (result (or
+ (nnimap-command "UID SEARCH CHARSET UTF-8 %s"
+ (encode-coding-string
+ (if (string= criteria "")
+ qstring
+ (nnir-imap-make-query
+ criteria qstring))
+ 'utf-8))
+ (nnimap-command "UID SEARCH %s"
+ (if (string= criteria "")
+ qstring
+ (nnir-imap-make-query
+ criteria qstring))))))
(mapc
(lambda (artnum)
(let ((artn (string-to-number artnum)))
--
1.7.2.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] (nnir-run-imap): try UTF-8 search first and go with US-ASCII if it doesn't work out.
2011-02-27 21:31 [PATCH] (nnir-run-imap): try UTF-8 search first and go with US-ASCII if it doesn't work out Gergely Risko
@ 2011-03-05 11:33 ` Lars Magne Ingebrigtsen
2011-03-05 14:18 ` Andrew Cohen
0 siblings, 1 reply; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-03-05 11:33 UTC (permalink / raw)
To: ding
Gergely Risko <gergely@risko.hu> writes:
> + 'utf-8))
Looks OK to me.
Andrew?
Also, do you have FSF copyright assignment papers on file?
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] (nnir-run-imap): try UTF-8 search first and go with US-ASCII if it doesn't work out.
2011-03-05 11:33 ` Lars Magne Ingebrigtsen
@ 2011-03-05 14:18 ` Andrew Cohen
2011-03-15 17:43 ` Lars Magne Ingebrigtsen
2011-03-27 17:02 ` Gergely Risko
0 siblings, 2 replies; 5+ messages in thread
From: Andrew Cohen @ 2011-03-05 14:18 UTC (permalink / raw)
To: ding
>>>>> "Lars" == Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
Lars> Gergely Risko <gergely@risko.hu> writes:
>> + 'utf-8))
Lars> Looks OK to me.
Lars> Andrew?
Sorry, I have been away for awhile. I tried this approach ages ago when
Steiner first reported an issue with UTF8 but never got it to work
consistently. For me, with a dovecot server, I get exactly the same
results with or without the addition of the CHARSET directive. I had
wanted to understand exactly why this was before making the change. On
the other hand, it doesn't really hurt anything, so I don't think there
is reason NOT to make the change, especially if it is helping some.
Best,
Andy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] (nnir-run-imap): try UTF-8 search first and go with US-ASCII if it doesn't work out.
2011-03-05 14:18 ` Andrew Cohen
@ 2011-03-15 17:43 ` Lars Magne Ingebrigtsen
2011-03-27 17:02 ` Gergely Risko
1 sibling, 0 replies; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-03-15 17:43 UTC (permalink / raw)
To: ding
Andrew Cohen <cohen@andy.bu.edu> writes:
> On the other hand, it doesn't really hurt anything, so I don't think
> there is reason NOT to make the change, especially if it is helping
> some.
Okidoke.
Gergely, do you have FSF copyright assignment papers on file? The patch
is more than 10 lines long, so it won't count as a "tiny change"...
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] (nnir-run-imap): try UTF-8 search first and go with US-ASCII if it doesn't work out.
2011-03-05 14:18 ` Andrew Cohen
2011-03-15 17:43 ` Lars Magne Ingebrigtsen
@ 2011-03-27 17:02 ` Gergely Risko
1 sibling, 0 replies; 5+ messages in thread
From: Gergely Risko @ 2011-03-27 17:02 UTC (permalink / raw)
To: ding
On Sat, 05 Mar 2011 09:18:03 -0500, Andrew Cohen <cohen@andy.bu.edu> writes:
> Sorry, I have been away for awhile. I tried this approach ages ago
> when Steiner first reported an issue with UTF8 but never got it to
> work consistently. For me, with a dovecot server, I get exactly the
> same results with or without the addition of the CHARSET directive. I
> had wanted to understand exactly why this was before making the
> change. On the other hand, it doesn't really hurt anything, so I don't
> think there is reason NOT to make the change, especially if it is
> helping some.
I have tested this with my Cyrus IMAP server and this change was needed
to make accented searches work. Actually I do not see how dovecot can
work without this info, maybe it assumed UTF-8 on your input.
Anyway, as you say, I tried to make the change as unobtrusive as
possible, so I really hope that it won't hurt anyone.
I replied in private about the FSF to Lars.
Thanks for considering,
Gergely
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-03-27 17:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-27 21:31 [PATCH] (nnir-run-imap): try UTF-8 search first and go with US-ASCII if it doesn't work out Gergely Risko
2011-03-05 11:33 ` Lars Magne Ingebrigtsen
2011-03-05 14:18 ` Andrew Cohen
2011-03-15 17:43 ` Lars Magne Ingebrigtsen
2011-03-27 17:02 ` Gergely Risko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).