I am building an app running on GAE which receives input from users via webform:
myUnicodeString = cgi.escape(self.request.get('myForm'))
It all works fine locally but after deployment unicode literals are converted into strings of the form: "E2=80=9C no problems with ASCII strings" Having read Nick's comment here not to use cgi.escape I was wondering that it might be the culprit. I have also tried adding
from __future__ import unicode_literals
after reading this post but then the program throws an error (TypeError: character mapping must return integer, None or unicode) which is apparently triggered by webapp2_extras session
Any ideas greatly appreciated!
UPDATE: I have noticed that this decoding/encoding issue has something to do with the text input fields submitted in the same form as the file uploaded to the blobstore. No problems occur while I save the same non ASCII strings via separate forms or via ajax.
UPDATE2: This is apparently the bug that causes the problem.