Closed user3472g closed 8 months ago
Thank you for the report, I'll look into it
@user3472g rtfparse's error handling is at fault. The RTF you are trying to decode says it is using the ANSI encoding. The codec for this is only available on Python on a Windows platform. Your python is unable to find the ansi codec, so it threw the LookupError which is not handled by rtfparse.
I will publish a bugfix which will handle this Error properly, but rtfparse will still be unable to parse ansi-encoded RTFs on non-Windows platforms.
Wikipedia writes that "Windows-1252 is referred to as "ANSI" especially often" so I will try to interpret it as cp1252, I guess it's that instead. I have never seen an RTF to use MBCS (what python understands under "ansi")
@user3472g try the rtfparse 0.8.1, you can upgrade via pip
rtfparse 0.8.0 fails immediately whilst attempting to parse valid RTF file
Usage:
pip3 install rtfparse rtfparse -r file.rtf