From: Sebastian Spaeth <Sebastian@SSpaeth.de>
To: Patrick Totzke <patricktotzke@googlemail.com>, notmuch@notmuchmail.org
Subject: Re: [python] querystrings as unicode literals?
Date: Mon, 11 Jul 2011 11:32:27 +0200 [thread overview]
Message-ID: <87k4bpxivo.fsf@SSpaeth.de> (raw)
In-Reply-To: <20110707113700.GA16347@megatron>
[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]
On Thu, 7 Jul 2011 12:37:00 +0100, Patrick Totzke <patricktotzke@googlemail.com> wrote:
> Hi!
> Something strange goes on when I use unicode literals as querystrings:
> Database().create_query(u'teststring') yields different results than
> Database().create_query('teststring')..
>
> Now it should not be a problem to decode the string to whatever encoding
> is used by notmuch/xapian internally using 'teststring'.encode('utf8')
> for example. But can I reliably expect all strings in the index to be valid utf8?
>
> At any rate, I think this conversion should be made from inside the bindings.
> A query should return the same results for querystrings as string- and unicode literals.
> Any thoughts?
I hate encodings and they always confuse the heck out of me. I would
prefer if everything was always UTF8. notmuch.h actually doesn't state
which encoding the query string should be and neither did
http://xapian.org/docs/queryparser.html. ojwb said, it takes UTF-8, so
that's what we should be doing.
I'll send a patch as a reply shortly, Patrick, do you care to test if
this fixes things for you?
Sebastian
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2011-07-11 9:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-07 11:37 [python] querystrings as unicode literals? Patrick Totzke
2011-07-11 9:32 ` Sebastian Spaeth [this message]
2011-07-11 9:43 ` [PATCH] python: Encode query string as a utf-8 byte array Sebastian Spaeth
2011-07-11 9:49 ` [PATCH v2] " Sebastian Spaeth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k4bpxivo.fsf@SSpaeth.de \
--to=sebastian@sspaeth.de \
--cc=notmuch@notmuchmail.org \
--cc=patricktotzke@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
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 read-only IMAP folder(s) and NNTP newsgroup(s).