Instead of encoding to utf-8
, one should encode to what ever the paypal is using for the post.
It is available under key 'charset' in the form paypal sends.
So the following code worked for me:
data = dict([(k, v.encode(data['charset'])) for k, v in data.items()])