]> git.donarmstrong.com Git - lilypond.git/commitdiff
MusicXML: replace soft-hyphens in the lyrics with soft dash
authorReinhold Kainhofer <reinhold@kainhofer.com>
Wed, 29 Aug 2007 23:06:19 +0000 (01:06 +0200)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 1 Sep 2007 03:07:33 +0000 (00:07 -0300)
Soft-hypens (created by an OMR software from scans) will make the
ascii codec as well as lilypond later barf on that unicode character.

python/musicxml.py

index d394697c54eae5225a77d97b9d85d0d5da20b698..0d4813de1db5607dbd05963504a2bce0a673f831 100644 (file)
@@ -1,4 +1,5 @@
 import new
+import string
 from rational import *
 
 class Xml_node:
@@ -326,6 +327,10 @@ class Lyric (Music_xml_node):
         
         if text:
             text = text.get_text()
+            # We need to convert soft hyphens to -, otherwise the ascii codec as well
+            # as lilypond will barf on that character
+            text = string.replace( text, u'\xad', '-' )
+        
         if text == "-" and continued:
             return "--"
         elif text == "_" and continued: