开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜