0

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.

Community
  • 1
  • 1
  • Did you read Nick's answer at the same place he posted that comment? That has everything you need to know. – new name Jul 07 '16 at 12:43
  • Possible duplicate of [Google App Engine TextProperty and UTF-8: When to Encode/Decode](http://stackoverflow.com/questions/10766472/google-app-engine-textproperty-and-utf-8-when-to-encode-decode) – new name Jul 07 '16 at 12:47
  • The thing is that when I use bottle framework on GAE I don't encounter any problems with request.get after deployment. As mentioned above I everything is fine with the code running on webapp2 but only locally. – Stanisław Łabądź Jul 07 '16 at 13:12

0 Answers0