{"action":"opened","issue":{"url":"https://api.github.com/repos/cloudinary/pycloudinary/issues/45","labels_url":"https://api.github.com/repos/cloudinary/pycloudinary/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/cloudinary/pycloudinary/issues/45/comments","events_url":"https://api.github.com/repos/cloudinary/pycloudinary/issues/45/events","html_url":"https://github.com/cloudinary/pycloudinary/issues/45","id":56671577,"number":45,"title":"public_id UnicodeEncodeError","user":{"login":"oppianmatt","id":48596,"avatar_url":"https://avatars.githubusercontent.com/u/48596?v=3","gravatar_id":"","url":"https://api.github.com/users/oppianmatt","html_url":"https://github.com/oppianmatt","followers_url":"https://api.github.com/users/oppianmatt/followers","following_url":"https://api.github.com/users/oppianmatt/following{/other_user}","gists_url":"https://api.github.com/users/oppianmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/oppianmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppianmatt/subscriptions","organizations_url":"https://api.github.com/users/oppianmatt/orgs","repos_url":"https://api.github.com/users/oppianmatt/repos","events_url":"https://api.github.com/users/oppianmatt/events{/privacy}","received_events_url":"https://api.github.com/users/oppianmatt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-05T13:45:26Z","updated_at":"2015-02-05T13:45:26Z","closed_at":null,"body":"We are in the process of converting our images from upload to private and they way we were told was to use the api to 'upload' each one as you can't change type. Problem is some of our images have unicode in the public_id yet the uploaded can't handle it. Here is an example:\r\n\r\nWe get the following resource in a list of resources from the api:\r\n\r\n```\r\n{u'secure_url': u'https://res.cloudinary.com/pitchup-com/image/upload/v1415177888/Camping_Man%C3%A9_Guernehu%C3%A9_txftuc.jpg', u'public_id': u'Camping_Man\\xe9_Guernehu\\xe9_txftuc', u'format': u'jpg', u'url': u'http://res.cloudinary.com/pitchup-com/image/upload/v1415177888/Camping_Man%C3%A9_Guernehu%C3%A9_txftuc.jpg', u'backup': True, u'created_at': u'2014-11-05T08:58:08Z', u'bytes': 18311, u'height': 131, u'width': 272, u'version': 1415177888, u'type': u'upload', u'resource_type': u'image'}\r\n```\r\n\r\nWe call 'upload' like so:\r\n\r\n```\r\n                meta = upload(\r\n                    resource['url'],\r\n                    public_id=resource['public_id'],\r\n                    eager=eager,\r\n                    eager_async=True,\r\n                    tags=tags,\r\n                    type=settings.CLOUDINARY_TYPE,\r\n                    image_metadata=True,\r\n                )\r\n```\r\n\r\nand then we get the following stack trace:\r\n\r\n```\r\n  File \"/usr/local/lib/python2.7/dist-packages/cloudinary/uploader.py\", line 16, in upload\r\n    return call_api(\"upload\", params, file = file, **options)\r\n  File \"/usr/local/lib/python2.7/dist-packages/cloudinary/uploader.py\", line 158, in call_api\r\n    params = utils.sign_request(params, options)\r\n  File \"/usr/local/lib/python2.7/dist-packages/cloudinary/utils.py\", line 114, in sign_request\r\n    params[\"signature\"] = api_sign_request(params, api_secret)\r\n  File \"/usr/local/lib/python2.7/dist-packages/cloudinary/utils.py\", line 120, in api_sign_request\r\n    to_sign = \"&\".join(sorted([(k+\"=\"+(\",\".join(v) if isinstance(v, list) else str(v))) for k, v in params_to_sign.items() if v]))\r\nUnicodeEncodeError: 'ascii' codec can't encode character u'\\xe9' in position 11: ordinal not in range(128)\r\n```"}}