changeset 3708:ce632fad1b03

AttachFile action: when unzipping member files, decode their filenames from utf-8 and replace invalid chars
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 12 Jun 2008 22:57:40 +0200
parents f0532fa90c6d
children 76a8e10cc022
files MoinMoin/action/AttachFile.py
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Thu Jun 12 21:57:20 2008 +0200
+++ b/MoinMoin/action/AttachFile.py	Thu Jun 12 22:57:40 2008 +0200
@@ -888,6 +888,7 @@
                 mapping = []  # zip is not acceptable
                 break
             finalname = name[fname_index:]  # remove common path prefix
+            finalname = finalname.decode(config.charset, 'replace')  # replaces trash with \uFFFD char
             mapping.append((name, finalname))
             new_fsizes[finalname] = zi.file_size