From 247128b91e842665185aed61cb630838fae66ca1 Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Thu, 30 Aug 2007 01:06:19 +0200 Subject: [PATCH] Replace soft-hyphens in the lyrics (created by an OMR software from scans) to an ordinary ascii dash. Otherwise the ascii codec as well as lilypond later on will barf on that unicode character. --- python/musicxml.py | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/python/musicxml.py b/python/musicxml.py index d394697..0d4813d 100644 --- a/python/musicxml.py +++ b/python/musicxml.py @@ -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: -- 1.5.2.3