From 8eaf2836e1149a3de4d38ee4583759a1f275f531 Mon Sep 17 00:00:00 2001
From: "J.-S. Caux" <J.S.Caux@uva.nl>
Date: Fri, 19 Jan 2018 21:16:01 +0100
Subject: [PATCH] Try another forced encoding

---
 journals/views.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/journals/views.py b/journals/views.py
index 23c268524..37c12218b 100644
--- a/journals/views.py
+++ b/journals/views.py
@@ -767,8 +767,8 @@ def metadata_xml_deposit(request, doi_label, option='test'):
             paper=publication.get_paper_nr(),
             doi=publication.doi_label.replace('.', '_'),
             timestamp=timestamp)
-        f = open(settings.MEDIA_ROOT + path_with_timestamp, 'w')
-        f.write(publication.metadata_xml.encode('utf8'))
+        f = open(settings.MEDIA_ROOT + path_with_timestamp, 'w', encoding='utf-8')
+        f.write(publication.metadata_xml)
         f.close()
 
         # Copy file
-- 
GitLab