striprtf icon indicating copy to clipboard operation
striprtf copied to clipboard

I get an error with while encoding character '\u200b'.

Open leacardenas opened this issue 3 years ago • 2 comments

I have been using the striprtf libraty and it has worked great! But, for some of the texts I that I am decoding I get the following error:

'charmap' codec can't encode character '\u200b' in position 0: character maps to

And I have tried mutliple things to be able to replace, encode or ignore the '\u200b' character but I coudn't. So I wanted to report the issue, since the library works very good.

I attached a txt version of the rtf file, since rtf is not accepted by GitHub.

9379.txt

leacardenas avatar Dec 06 '21 18:12 leacardenas

Hi, there is now an option to ignore errors. Please try it with: rtf_to_text(your_string, errors="ignore") It was working for me, but I don't know if relevant text is stripped away.

joshy avatar Dec 08 '21 13:12 joshy

Hi, yeah I saw that option, but I understand that indeed the text with the flaw is stripped away.

I will check still if that charater is on the text or the rtf as such.

leacardenas avatar Dec 08 '21 15:12 leacardenas