mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
RTF Input: Fix bug preventing it from running. RTF Output: produce files that can be read by RTF input.
This commit is contained in:
parent
3d4ae1920a
commit
1c2f1b0f00
@ -70,7 +70,7 @@ class RTFInput(InputFormatPlugin):
|
||||
self.log = log
|
||||
self.log('Converting RTF to XML...')
|
||||
try:
|
||||
xml = self.generate_xml(stream)
|
||||
xml = self.generate_xml(stream.name)
|
||||
except RtfInvalidCodeException:
|
||||
raise ValueError(_('This RTF file has a feature calibre does not '
|
||||
'support. Convert it to HTML first and then try it.'))
|
||||
|
@ -30,7 +30,7 @@ class RTFOutput(OutputFormatPlugin):
|
||||
|
||||
out_stream.seek(0)
|
||||
out_stream.truncate()
|
||||
out_stream.write(content.encode('cp1252', 'replace'))
|
||||
out_stream.write(content.encode('ascii', 'replace'))
|
||||
|
||||
if close:
|
||||
out_stream.close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user