changeset 601:4bbd2206f75d

utf-8 attachment fixes for moin dump
author tw@waldmann-edv.de
date Mon, 24 Apr 2006 21:04:16 +0200
parents 09a1f076f45c
children 24f37913f1ef
files MoinMoin/script/export/dump.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/script/export/dump.py	Sun Apr 23 21:59:16 2006 +0200
+++ b/MoinMoin/script/export/dump.py	Mon Apr 24 21:04:16 2006 +0200
@@ -53,11 +53,12 @@
 '''
 
 def _attachment(request, pagename, filename, outputdir):
+    filename = filename.encode(config.charset)
     source_dir = AttachFile.getAttachDir(request, pagename)
     source_file = os.path.join(source_dir, filename)
     dest_dir = os.path.join(outputdir, "attachments", wikiutil.quoteWikinameFS(pagename))
     dest_file = os.path.join(dest_dir, filename)
-    dest_url = "attachments/%s/%s" % (wikiutil.quoteWikinameFS(pagename), filename)
+    dest_url = "attachments/%s/%s" % (wikiutil.quoteWikinameFS(pagename), wikiutil.url_quote(filename))
     if os.access(source_file, os.R_OK):
         if not os.access(dest_dir, os.F_OK):
             try: