summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter/search/__init__.py
diff options
context:
space:
mode:
authorJefferson Stachelski <jstachel@thoughtworks.com>2015-03-18 19:09:03 -0300
committerJefferson Stachelski <jstachel@thoughtworks.com>2015-03-18 19:12:05 -0300
commitd732de6df06ed8e18647e19b13534da11fdc7ff5 (patch)
treef5b6e892dc0a46b23359c6ca2096f5aa96228a71 /service/pixelated/adapter/search/__init__.py
parente9648ca996cc195fc19a8ca1ceac016a1ff0ca5b (diff)
#248 Fixed the UTF-8 decode for special characteres
Diffstat (limited to 'service/pixelated/adapter/search/__init__.py')
-rw-r--r--service/pixelated/adapter/search/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/service/pixelated/adapter/search/__init__.py b/service/pixelated/adapter/search/__init__.py
index 33259e63..331ea8fe 100644
--- a/service/pixelated/adapter/search/__init__.py
+++ b/service/pixelated/adapter/search/__init__.py
@@ -128,8 +128,8 @@ class SearchEngine(object):
tags.append(mail.mailbox_name.lower())
bounced = mail.bounced if mail.bounced else ['']
index_data = {
- 'sender': unicode(header.get('from', '')),
- 'subject': unicode(header.get('subject', '')),
+ 'sender': unicode(header.get('from', '').decode('utf-8')),
+ 'subject': unicode(header.get('subject', '').decode('utf-8')),
'date': milliseconds(header.get('date', '')),
'to': u','.join(header.get('to', [''])),
'cc': u','.join(header.get('cc', [''])),
@@ -139,7 +139,7 @@ class SearchEngine(object):
'body': unicode(mdict['textPlainBody']),
'ident': unicode(mdict['ident']),
'flags': unicode(','.join(unique(mail.flags))),
- 'raw': unicode(mail.raw)
+ 'raw': unicode(mail.raw.decode('utf-8'))
}
writer.update_document(**index_data)