From 1d7c3277ec760064a4760acc4da3a09652cf8ccf Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 27 Oct 2009 13:07:37 -0600 Subject: [PATCH] IGN:PML Output: Replace non breaking spaces with normal spaces --- src/calibre/ebooks/pml/pmlml.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/ebooks/pml/pmlml.py b/src/calibre/ebooks/pml/pmlml.py index 27e88eb48b..aa608496c7 100644 --- a/src/calibre/ebooks/pml/pmlml.py +++ b/src/calibre/ebooks/pml/pmlml.py @@ -153,6 +153,10 @@ class PMLMLizer(object): for unused in anchors.difference(links): text = text.replace('\\Q="%s"' % unused, '') + # Replace bad characters. + text = text.replace(u'\xc2', '') + text = text.replace(u'\xa0', ' ') + # Turn all html entities into unicode. This should not be necessary as # lxml should have already done this but we want to be sure it happens. for entity in set(re.findall('&.+?;', text)):