From: Radek Czajka Date: Wed, 18 Aug 2010 09:09:33 +0000 (+0200) Subject: fix special characters X-Git-Tag: 1.7~275 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/143b2e4e4ebbcc4e3de1b23f56df933317b269ff fix special characters --- 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: