Encoding problem in Google AppEngine when BlobstoreUploadHandler
I am seeing weird characters in the datastore when reading them in BlobstoreUploadHandler. The problem is only on Google servers, everything works great on the development server.
This usually works:
item = models.Item()
item.description = self.request.get("description")
item.put()
However, if this is within a BlobstoreUploadHandler, the description text is all messed up. The cor开发者_Go百科rupted characters or on the form '=XX', where X is a hex. Line breaks are also corrupted.
Explanation on how it is best to deal with unicode in user submitted content would be appreciated.
Update: It is a known bug. I still don't have a workaround yet.
It's a known bug, check Blobstore handler breaking data encoding issue.
Performing a POST to a Blobstore handler, test fields are getting converted to MIME quoted printable format.
I think you could workaround this using quopri Python standard module.
精彩评论