Skip to main content

Encoder for unicode to RTF 1.5 command sequences

Project description

This module implements an encoder for unicode to RTF 1.5 command sequences; it can be used to generate valid RTF output with international characters.

Importing this module adds a new rtfunicode codec, allowing you to encode unicode strings to valid RTF bytecode sequences:

>>> import rtfunicode
>>> u'RTF and unicode mix just fine! \u263A'.encode('rtfunicode')
'RTF and unicode mix just fine! \\u9786?'

The RTF command code for a unicode character is uN?, where N is a signed 16-bit integer and the ? is a placeholder character for older RTF readers. This module sets the latter to the ‘?’ literal for simlicity’s sake.

Requirements

  • Python 3.3-3.8

Development

https://travis-ci.org/mjpieters/rtfunicode.svg?branch=master

The project code is hosted on GitHub, feel free to report issues, fork the code and issue pull requests.

License

BSD (simplified), see: LICENSE.txt

Author

Martijn Pieters <mj@zopatista.com>

2.0 (2020-02-03)

  • Removed Python 2 compatibility.

1.4 (2016-06-13)

  • Add a MANIFEST.in template to make sure CHANGES.rst is included in the distribution.

1.3 (2016-06-06)

  • Removed limitations section from README as these were removed in 1.1.

1.2 (2016-06-06)

  • Correct LICENSE.txt file.

1.1 (2016-06-06)

  • Support surrogate pairs by using math text-run groups.

  • Drop support for Python 3.1 and 3.2; 3.3 - 3.5 are now officially supported.

1.0 (2012-06-06)

  • Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rtfunicode-2.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

rtfunicode-2.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file rtfunicode-2.0.tar.gz.

File metadata

  • Download URL: rtfunicode-2.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.6

File hashes

Hashes for rtfunicode-2.0.tar.gz
Algorithm Hash digest
SHA256 97d2e860fd4abaae2de5df1e59bb18b85ba0caebf40c53de8ddb79ec8d884401
MD5 e6c938f05514cfc9d2da5ca08f679ec1
BLAKE2b-256 26545d82ee41cffaef86553c349606dbc0f4ca0a10ca1c19cf89f5f8c41deaef

See more details on using hashes here.

File details

Details for the file rtfunicode-2.0-py3-none-any.whl.

File metadata

  • Download URL: rtfunicode-2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.6

File hashes

Hashes for rtfunicode-2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eea3912e3d1b00bce912950ea562cb192dd507f78c4fa2f58daa1c60b64bd6ad
MD5 51d05fc5183957daed5c0dbbd4c6fe0d
BLAKE2b-256 11f0bd1006eb77b57ae1c9e00a2db3e34fd61a50c4f1e174466f3b5df34de259

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page