andrewlkho / icloud-addressbook-query Goto Github PK
View Code? Open in Web Editor NEWIntegrate mutt with iCloud-synced Address Book
Integrate mutt with iCloud-synced Address Book
Although accented characters are displayed correctly from the command line, mutt does not appear to handle them well. This bug was submitted via e-mail by Ronaldo Vasconcellos. Here is his message in full:
Hello Andrew.
Just a feedback from a Brazilian user.
The script works like a charm for me, except when my contact has accents on its
name (which are common in Brazilian portuguese). The error happens only inside
mutt, not when run from the terminal.To: fabioTraceback (most recent call last):
File "/usr/local/bin/icloud-addressbook-query.py", line 55, in
main()
File "/usr/local/bin/icloud-addressbook-query.py", line 52, in main
output(query_db(sys.argv[1]))
File "/usr/local/bin/icloud-addressbook-query.py", line 44, in output
print "\t".join([row[0], fn])
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in positi
on 25: ordinal not in range(128)Outside mutt it works:
$ /usr/local/bin/icloud-addressbook-query.py fabio
3 matching addresses...
[email protected] Fábio XXX
[email protected] Fábio XXX
fabio3@example Fábio XXXAny clue of what's going on here? Seems like a character encoding issue.
My terminal setup is slightly different from usual. I'm using iTerm
(http://www.iterm2.com/#/section/home) and Fish (http://fishshell.com/) shell.Cheers,
Ron
Hello Andrew,
I'm encountering the following error when retrieving a particular contact.
The contact's email address has a hyphen (-) in it; do you think that would cause the problem? Other contacts can be searched without issue.
icloud-addressbook-query $ python icloud-addressbook-query.py Jeff
1 matching addresses...
Traceback (most recent call last):
File "icloud-addressbook-query.py", line 56, in <module>
main()
File "icloud-addressbook-query.py", line 53, in main
output(query_db(sys.argv[1]))
File "icloud-addressbook-query.py", line 44, in output
out = "\t".join([row[0], fn])
TypeError: sequence item 1: expected string or Unicode, NoneType found
icloud-addressbook-query $ python --version
Python 2.7.5
Thanks for this useful utility. I've been happily using it for the past year or so.
Mike
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.