fix encoding issue
This commit is contained in:
parent
23fe7d6c56
commit
94168c01ae
|
@ -552,8 +552,8 @@ def sanitize_filename(filename):
|
||||||
"""
|
"""
|
||||||
# 48 is the limit
|
# 48 is the limit
|
||||||
if len(filename) > 48:
|
if len(filename) > 48:
|
||||||
hash = hashlib.md5(filename)
|
hash = hashlib.md5(filename.encode('utf-8'))
|
||||||
filename = base64.b64encode(hash.digest())
|
filename = base64.b64encode(hash.digest()).decode('utf-8')
|
||||||
|
|
||||||
# make it latin chars only
|
# make it latin chars only
|
||||||
filename = punycode_encode(filename).decode('utf-8')
|
filename = punycode_encode(filename).decode('utf-8')
|
||||||
|
|
Loading…
Reference in New Issue