forked from openlp/openlp
Cleanup.
This commit is contained in:
parent
aef1c550e0
commit
7871dfdf00
@ -559,7 +559,6 @@ def strip_rtf(text, default_encoding=None):
|
|||||||
out.append(unichr(c))
|
out.append(unichr(c))
|
||||||
curskip = ucskip
|
curskip = ucskip
|
||||||
elif word == u'fonttbl':
|
elif word == u'fonttbl':
|
||||||
inside_font_table = True
|
|
||||||
ignorable = True
|
ignorable = True
|
||||||
elif word == u'f':
|
elif word == u'f':
|
||||||
font = arg
|
font = arg
|
||||||
@ -575,14 +574,14 @@ def strip_rtf(text, default_encoding=None):
|
|||||||
curskip -= 1
|
curskip -= 1
|
||||||
elif not ignorable:
|
elif not ignorable:
|
||||||
charcode = int(hex, 16)
|
charcode = int(hex, 16)
|
||||||
encoding, default_encoding = get_encoding(font, font_table,
|
failed = False
|
||||||
default_encoding)
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
|
encoding, default_encoding = get_encoding(font,
|
||||||
|
font_table, default_encoding, failed=failed)
|
||||||
out.append(chr(charcode).decode(encoding))
|
out.append(chr(charcode).decode(encoding))
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
encoding, default_encoding = get_encoding(font,
|
failed = True
|
||||||
font_table, default_encoding, failed=True)
|
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
elif tchar:
|
elif tchar:
|
||||||
|
Loading…
Reference in New Issue
Block a user