rtfunicode is a Python library (version 2.3) that provides an encoder for Unicode to RTF 1.5 command sequences. It allows for generating valid RTF output that includes international characters by registering a new `rtfunicode` codec, which can then be used directly with `str.encode()`. The library is actively maintained, with a focus on modern Python versions.
pip install rtfunicodeVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to import `rtfunicode` to register its codec, and then use the `encode('rtfunicode')` method on a standard Python string to convert Unicode characters into their RTF 1.5 command sequences.
Upgrade Python to 3.10+ or install `pip install rtfunicode==2.2` for Python 3.9.
Ensure your Python environment is 3.10 or newer. If legacy Python is required, use `rtfunicode<2.1`.
Verify that custom tooling or internal module references are compatible with the package structure. The main usage (`import rtfunicode`) is unaffected.
Be aware of the fixed placeholder. For specific fallback character requirements, inspect the RTF output and implement post-processing if necessary.
Add `import rtfunicode` at the beginning of your script. Importing the module registers the codec.
Upgrade your Python environment to 3.10 or newer. Alternatively, install a compatible older version like `pip install rtfunicode==2.2` for Python 3.9.
Ensure your Python environment is 3.10 or newer when using rtfunicode versions 2.1+. Upgrade Python if necessary.