From 0574098ee5e83af8d0187ac9ffae06544c68696d Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Sun, 1 Jun 2014 10:33:37 +0200 Subject: [PATCH] gallery: Add support for non-english captions --- gallery/gallery.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gallery/gallery.py b/gallery/gallery.py index d72c338..7c54cf3 100644 --- a/gallery/gallery.py +++ b/gallery/gallery.py @@ -22,7 +22,8 @@ def add_gallery_post(generator): galleryimages.append(i) if 'gallerycaptions' in article.metadata.keys(): - gallerycaptions = ast.literal_eval(article.metadata.get('gallerycaptions')) + line = article.metadata.get('gallerycaptions').encode('ascii','xmlcharrefreplace') + gallerycaptions = ast.literal_eval(line) article.album = album article.galleryimages = sorted(galleryimages)