python – GAE blobstore文件名UTF-8编码问题

我在GAE blobstore中有一些文件名编码问题.

class UploadHandler(blobstore_handlers.BlobstoreUploadHandler):
    def post(self):
        upload_files = self.get_uploads('file') 
        blob_info = upload_files[0]

        #Problem right here    
        decoded_filename = blob_info.filename.decode("utf-8")
        #

        File_info = Fileinfo(
            key_name=str(blob_info.key()),
            filename=decoded_filename,
            )
        File_info.put()
        self.redirect("/")

当我在本地运行时,它在SDK控制台中正常运行,

但上传到GAE后,它会显示为非解码字符串
“=?UTF-8 2 B 4 54Wn54mH5pel5pyfIDIwMTAtMDgtMDM =?=”
或=?Big5?B?v8O59afWt9MgMjAxMC0xMi0wMiA =?=

我怀疑最好的解决方案可能是,
停止使用中文字符文件名…

所有建议都非常欢迎:)

最佳答案 这是一个悬而未决的问题:Blobstore处理程序打破数据编码,检查
here.

点赞