openphoto/import — pull request #11 by dcancel (2012-04-23 22:07:32+00:00)
Title: Add support for Unicode encoded strings

Hi,

I kept running into errors with unicode encoded strings in my Flickr photo titles and descriptions. I added some functions to deal with these strings.

### Example

*Sample string:*

{"description": "Landing Page Examples", "license": "CC BY-NC-SA", "title": "Web Based Project Management Software for Ad Agencies and Creative Firms | MAC Friendly | Workamajig\u00ae", "dateUploaded": 1256573124, "photo": "http://farm3.staticflickr.com/2747/4047109978_ff3db1b4d9_o.png", "tags": "landingpages,performable", "dateTaken": 1256573124, "permission": false, "id": "4047109978"}

*Error:*

```
Found a total of 982 files to process
Processing 1 of 982 20091026T120524-4047109978.json ...
Traceback (most recent call last):
File "import.py", line 110, in
import_into_openphoto(client)
File "import.py", line 66, in import_into_openphoto
resp = client.post('/photo/upload.json', params)
File "/Library/Python/2.7/site-packages/openphoto-0.1-py2.7.egg/openphoto/__init__.py", line 41, in post
body = urllib.urlencode(params)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 1294, in urlencode
v = quote_plus(str(v))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xae' in position 100: ordinal not in range(128)
```