From c71690d510c8bd223cb37c3f601a8b8f749bad10 Mon Sep 17 00:00:00 2001 From: John Schember Date: Sun, 23 Feb 2014 16:04:42 -0500 Subject: [PATCH] Fix Bug #1268118: epub converted produces invalid .rtf file --- src/calibre/ebooks/rtf/rtfml.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/calibre/ebooks/rtf/rtfml.py b/src/calibre/ebooks/rtf/rtfml.py index 53d0c6ea07..aafcf52aa8 100644 --- a/src/calibre/ebooks/rtf/rtfml.py +++ b/src/calibre/ebooks/rtf/rtfml.py @@ -71,6 +71,7 @@ def txt2rtf(text): # Escape { and } in the text. text = text.replace('{', r'\'7b') text = text.replace('}', r'\'7d') + text = text.replace('\\', r'\'5c') if not isinstance(text, unicode): return text