forked from openlp/openlp
A unicode fix for songs
This commit is contained in:
parent
95acdbfde0
commit
b100731dc4
@ -134,7 +134,8 @@ class SongXMLParser(object):
|
||||
The XML of the song to be parsed.
|
||||
"""
|
||||
try:
|
||||
self.song_xml = ElementTree(element=XML(xml))
|
||||
self.song_xml = ElementTree(
|
||||
element=XML(unicode(xml).encode('unicode-escape')))
|
||||
except:
|
||||
log.exception(u'Invalid xml %s', xml)
|
||||
|
||||
@ -147,7 +148,8 @@ class SongXMLParser(object):
|
||||
verse_list = []
|
||||
for element in iter:
|
||||
if element.tag == u'verse':
|
||||
verse_list.append([element.attrib, element.text])
|
||||
verse_list.append([element.attrib,
|
||||
unicode(element.text).decode('unicode-escape')])
|
||||
return verse_list
|
||||
|
||||
def dump_xml(self):
|
||||
|
@ -291,7 +291,7 @@ class SongMediaItem(MediaManagerItem):
|
||||
service_item.editId = item_id
|
||||
service_item.verse_order = song.verse_order
|
||||
if song.lyrics.startswith(u'<?xml version='):
|
||||
songXML=SongXMLParser(song.lyrics)
|
||||
songXML = SongXMLParser(song.lyrics)
|
||||
verseList = songXML.get_verses()
|
||||
for verse in verseList:
|
||||
if verse[1]:
|
||||
|
Loading…
Reference in New Issue
Block a user