The file name is BlobInfo MIME-encoded by Google. I do not know why Google does this.
It is broken for people living in multibyte countries.
You can get the correct file name if you use any character code, as shown below:
import email for blob_info in self.get_uploads('file'): filename_mime = blob_info.filename if isinstance(filename_mime, unicode): filename_mime_utf8 = filename_mime.encode('utf-8') else: filename_mime_utf8 = filename_mime filename_encoded, encoding = email.header.decode_header(filename_mime_utf8)[0] if encoding is not None: filename_unicode = filename_encoded.decode(encoding) filename_utf8 = filename_unicode.encode('utf-8') blob_info._BlobInfo__entity['filename'] = filename_utf8
source share