Skip to content

Commit

Permalink
[issue/1] fix issue for display content with some special unicode chars
Browse files Browse the repository at this point in the history
  • Loading branch information
xeric committed Jan 21, 2019
1 parent a7b65a0 commit 594eef8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ Mail content search is based on preview content, not full text of mail, so will
</dict>
</dict>
<key>version</key>
<string>0.0.6</string>
<string>0.0.7</string>
<key>webaddress</key>
<string></string>
<string>https://github.com/xeric/alfred-outlook</string>
</dict>
</plist>
10 changes: 5 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
def main(wf):
query = wf.decode(sys.argv[1])

handle(query)
handle(wf, query)

log.info('searching mail with keyword')

def handle(query):
def handle(wf, query):
if (len(query) < 3):
wf.add_item(title='Type more characters to serach...',
subtitle='too less characters will lead huge irrelevant results',
Expand All @@ -49,7 +49,7 @@ def handle(query):
page = 0 if m is None else int(m.group(1))
if page:
query = query.replace('|' + str(page), '')
log.info("query string is: " + unicode(query))
log.info("query string is: " + query)
log.info("query page is: " + str(page))

searchType = 'All'
Expand Down Expand Up @@ -86,12 +86,12 @@ def handle(query):
searchMethod = getattr(sys.modules[__name__], 'query' + searchType)
searchMethod(cur, keywords, offset, calculatedPageSize, folder)

if cur.rowcount:
if cur.rowcount:
for row in cur:
log.info(row[0])
path = outlookData + row[3]
if row[2]:
content = row[2].encode('ascii', 'ignore').decode('ascii')
content = wf.decode(row[2])
content = content.replace('\r\n', " ")
else:
content = "no content preview"
Expand Down

0 comments on commit 594eef8

Please sign in to comment.