--- a/ForgeWiki/forgewiki/wiki_main.py
+++ b/ForgeWiki/forgewiki/wiki_main.py
@@ -538,9 +538,9 @@
self.thumbnail.delete()
redirect(request.referer)
with self.attachment.open() as fp:
- filename = fp.metadata['filename']
+ filename = fp.metadata['filename'].encode('utf-8')
response.headers['Content-Type'] = ''
- response.content_type = fp.content_type
+ response.content_type = fp.content_type.encode('utf-8')
if not embed:
response.headers.add('Content-Disposition',
'attachment;filename=%s' % filename)
@@ -550,9 +550,9 @@
@expose()
def thumb(self, embed=False):
with self.thumbnail.open() as fp:
- filename = fp.metadata['filename']
+ filename = fp.metadata['filename'].encode('utf-8')
response.headers['Content-Type'] = ''
- response.content_type = fp.content_type
+ response.content_type = fp.content_type.encode('utf-8')
if not embed:
response.headers.add('Content-Disposition',
'attachment;filename=%s' % filename)