mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Fix bug #791805: RTF output does not handle { and } properly.
This commit is contained in:
parent
48db3defcf
commit
ae96797d33
@ -68,8 +68,13 @@ TODO:
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
def txt2rtf(text):
|
def txt2rtf(text):
|
||||||
|
# Escape { and } in the text.
|
||||||
|
text = text.replace('{', r'\'7b')
|
||||||
|
text = text.replace('}', r'\'7d')
|
||||||
|
|
||||||
if not isinstance(text, unicode):
|
if not isinstance(text, unicode):
|
||||||
return text
|
return text
|
||||||
|
|
||||||
buf = cStringIO.StringIO()
|
buf = cStringIO.StringIO()
|
||||||
for x in text:
|
for x in text:
|
||||||
val = ord(x)
|
val = ord(x)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user