guyzmo/notmuch-abook — pull request #21 by TomasTomecek (2014-07-10 08:26:59+00:00)
Title: fix UnicodeEncodeError when printing matches

Steps to reproduce:

Put names with unicode chars in address book, e.g.:
```
Janíčko Hraško
```
Query database like this:
```
subprocess.check_output(['notmuch_abook.py', '--verbose', 'lookup', 'hra'])
```

```
Traceback (most recent call last):
File "/home/ttomecek/dev/notmuch-abook/pylibs/notmuch_abook.py", line 464, in run
lookup_action(db, options[''], options['--format'])
File "/home/ttomecek/dev/notmuch-abook/pylibs/notmuch_abook.py", line 401, in lookup_action
print_address_list(db.lookup(match), output_format)
File "/home/ttomecek/dev/notmuch-abook/pylibs/notmuch_abook.py", line 354, in print_address_list
o = format_address(address, output_format).decode('ascii')
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0159' in position 3: ordinal not in range(128)
```

This happened to me in [alot](https://github.com/pazz/alot) MUA.