Support unicode filenames in staging folders.

This commit is contained in:
Roberto Rosario
2016-03-20 15:40:42 -04:00
parent b32563ac8e
commit 6ec7a2ca4d
2 changed files with 3 additions and 2 deletions

View File

@@ -25,6 +25,7 @@
- Remove the document index setup permission.
- Status messages now display the object class on which they operate not just the word "Object".
- More tests added.
- Handle unicode filenames in staging folders.
2.0.2 (2016-02-09)
==================

View File

@@ -50,10 +50,10 @@ class StagingFile(object):
self.encoded_filename = str(encoded_filename)
self.filename = base64.urlsafe_b64decode(
urllib.unquote_plus(self.encoded_filename)
)
).decode('utf8')
else:
self.filename = filename
self.encoded_filename = base64.urlsafe_b64encode(filename)
self.encoded_filename = base64.urlsafe_b64encode(filename.encode('utf8'))
def __unicode__(self):
return unicode(self.filename)