From 143b2e4e4ebbcc4e3de1b23f56df933317b269ff Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Wed, 18 Aug 2010 11:09:33 +0200 Subject: [PATCH] fix special characters --- librarian/epub.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/librarian/epub.py b/librarian/epub.py index a0d9742..92df2d4 100644 --- a/librarian/epub.py +++ b/librarian/epub.py @@ -103,12 +103,11 @@ def replace_characters(node): def replace_chars(text): if text is None: return None - return text.replace("&", "&")\ - .replace("---", "—")\ - .replace("--", "–")\ - .replace(",,", "„")\ - .replace('"', "”")\ - .replace("'", "’") + return text.replace("---", u"\u2014")\ + .replace("--", u"\u2013")\ + .replace(",,", u"\u201E")\ + .replace('"', u"\u201D")\ + .replace("'", u"\u2019") if node.tag == 'extra': node.clear() else: -- 2.20.1