diff --git a/HISTORY.rst b/HISTORY.rst index c1dc0a5188..61bfa3745c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -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) ================== diff --git a/mayan/apps/sources/classes.py b/mayan/apps/sources/classes.py index 847f573614..3ff49704af 100644 --- a/mayan/apps/sources/classes.py +++ b/mayan/apps/sources/classes.py @@ -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)