joshy / striprtf

Stripping rtf to plain old text
http://striprtf.dev
BSD 3-Clause "New" or "Revised" License
94 stars 27 forks source link

Add 'encoding' parameter in 'rtf_to_text' to overwrite default encoding #35

Closed jnth closed 2 years ago

jnth commented 2 years ago

And adding tests for this new parameter.

$ python3 -m unittest discover -v
test_polish (tests.test_ansicpg1250.TestUnicodePolish) ... ok
test_empty (tests.test_bytes.TestBytes) ... ok
test_full_table (tests.test_calcium_score.TestSimple) ... ok
test_empty (tests.test_encoding.TestEncoding) ... ok
test_empty (tests.test_french.TestSimple) ... ok
test_from_simple_string (tests.test_from_strings.TestFromString) ... ok
test_with_special_chars_and_encoding_parameter (tests.test_from_strings.TestFromString) ... ok
test_empty (tests.test_hello.TestHello) ... ok
test_hyperlinks (tests.test_hyperlinks.TestHyperlinks) ... ok
test_mac_textedit (tests.test_hyperlinks.TestHyperlinks) ... ok
test_user_sample (tests.test_hyperlinks.TestHyperlinks) ... ok
test_simplified_chinese (tests.test_issue_11.TestUnicodeSimplifiedChinese) ... ok
test_empty (tests.test_issue_15.TestUnicodeJapanese) ... ok
test_empty (tests.test_issue_20.UnknownEncoding) ... ok
test_empty (tests.test_issue_28.TestUnicodeJapanese) ... ok
test_bad (tests.test_issue_29.TestCyrillic) ... ok
test_good (tests.test_issue_29.TestCyrillic) ... ok
test_extract_simple_table (tests.test_line_breaks_google_docs.TestSimple) ... ok
test_extract_simple_table (tests.test_line_breaks_textedit_mac.TestSimple) ... ok
test_full_table (tests.test_nested_table.TestSimple) ... ok
test_empty (tests.test_nutridoc.TestSimple) ... ok
test_sample (tests.test_sample_3.TestSimple) ... ok
test_empty (tests.test_simple.TestSimple) ... ok
test_table (tests.test_simple.TestSimple) ... ok
test_speiseplan (tests.test_speiseplan.TestSpeiseplan) ... ok
test_empty (tests.test_unicode.TestUnicode) ... ok

----------------------------------------------------------------------
Ran 26 tests in 0.419s

OK
jnth commented 2 years ago

Thank you. Could you add a new release and publish the new version in PyPI ?

joshy commented 2 years ago

Thank you for the pull request. Done