https://github.com/mjpieters/rtfunicode
Encoder for unicode to RTF 1.5 command sequences
https://github.com/mjpieters/rtfunicode
python rtf unicode
Last synced: 5 months ago
JSON representation
Encoder for unicode to RTF 1.5 command sequences
- Host: GitHub
- URL: https://github.com/mjpieters/rtfunicode
- Owner: mjpieters
- License: bsd-2-clause
- Created: 2012-06-06T13:24:09.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2020-02-06T15:54:42.000Z (over 6 years ago)
- Last Synced: 2025-04-03T19:45:22.006Z (about 1 year ago)
- Topics: python, rtf, unicode
- Language: Python
- Size: 12.7 KB
- Stars: 18
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
Unicode to RTF command code conversion
======================================
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
>>> '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
-----------
.. image:: https://travis-ci.org/mjpieters/rtfunicode.svg?branch=master
:target: https://travis-ci.org/mjpieters/rtfunicode
The project code is hosted on GitHub_, feel free to report issues,
fork the code and issue pull requests.
.. _GitHub: https://github.com/mjpieters/rtfunicode
License
-------
BSD (simplified), see: LICENSE.txt
Author
------
Martijn Pieters