diff --git a/openlp/plugins/songs/lib/openlyricsexport.py b/openlp/plugins/songs/lib/openlyricsexport.py index d3367bfa9..17cc14421 100644 --- a/openlp/plugins/songs/lib/openlyricsexport.py +++ b/openlp/plugins/songs/lib/openlyricsexport.py @@ -73,6 +73,8 @@ class OpenLyricsExport(object): u', '.join([author.display_name for author in song.authors])) filename = re.sub( r'[/\\?*|<>\[\]":<>+%]+', u'_', filename).strip(u'_') - tree.write(os.path.join(self.save_path, filename), + file_object = open(os.path.join(self.save_path, filename), u'w') + tree.write(file_object, encoding=u'utf-8', xml_declaration=True, pretty_print=True) + file_object.close() return True