]> git.notmuchmail.org Git - notmuch/commit
python: represent message tags as unicode instances
authorSebastian Spaeth <Sebastian@SSpaeth.de>
Mon, 11 Jul 2011 13:02:12 +0000 (15:02 +0200)
committerSebastian Spaeth <Sebastian@SSpaeth.de>
Mon, 11 Jul 2011 13:02:12 +0000 (15:02 +0200)
commit687366b920caa5de6ea0b66b70cf2a11e5399f7b
treedac5041561985fdeea484682fb0ef440627b969b
parent504b6242d1fd67d04ee236fc92a54ca39fd682f7
python: represent message tags as unicode instances

Rather than returning simply strings and having to guess their encoding,
return explicit unicode() strings for the tags. Xapian stores UTF8, so
we know that they come as UTF8 encoded string.

Note: I tried to directly use the c_wchar_p type of the ctypes library
which translates directly into an unicode type, but that did not work
out so well, so we take c_char_p and .decode() them manually.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
bindings/python/notmuch/tag.py