RTF Output: Handle non-breakinf spaces correctly. Fixes #7668 (HTML to RTF (Non Breaking Space) v0.7.29)

This commit is contained in:
Kovid Goyal 2010-11-26 08:57:03 -07:00
parent 31e8fa91b3
commit 730f510e24

View File

@ -81,7 +81,9 @@ def txt2rtf(text):
buf = cStringIO.StringIO() buf = cStringIO.StringIO()
for x in text: for x in text:
val = ord(x) val = ord(x)
if val <= 127: if val == 160:
buf.write('\\~')
elif val <= 127:
buf.write(x) buf.write(x)
else: else:
repl = ascii_text(x) repl = ascii_text(x)