Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/enricobacis/utf9
Encode and decode text using UTF-9.
https://github.com/enricobacis/utf9
Last synced: about 2 months ago
JSON representation
Encode and decode text using UTF-9.
- Host: GitHub
- URL: https://github.com/enricobacis/utf9
- Owner: enricobacis
- License: mit
- Created: 2015-12-06T17:31:06.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-12-31T09:52:13.000Z (almost 4 years ago)
- Last Synced: 2024-10-07T10:10:50.814Z (3 months ago)
- Language: Python
- Homepage: https://pypi.python.org/pypi/utf9
- Size: 6.84 KB
- Stars: 10
- Watchers: 3
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
utf9
====*Encode and decode text using UTF-9.*
Description
-----------On April 1st 2005, IEEE released the `RFC4042`_ “*UTF-9 and UTF-18
Efficient Transformation Formats of Unicode*” :The current representation formats for Unicode (UTF-7, UTF-8,
UTF-16) are not storage and computation efficient on platforms that
utilize the 9 bit nonet as a natural storage unit instead of the 8
bit octet.Since there are not so many architecture that use *9 bit nonets as
natural storage units* and the release date was on April Fools’ Day, the
*beautiful* UTF-9 was forgotten and no python implementation is
available.This python module is here to fill this gap! ;)
Usage
-----There are only two functions:
- ``utf9encode(string)``: takes a string and returns a utf9-encoded
version.
- ``utf9decode(data)``: takes utf9-encoded data and returns the
corresponding string.Example
------->>> import utf9
>>> encoded = utf9.utf9encode(u'ႹЄLᒪo, 🌍ǃ')
>>> print repr(encoded)
'p\xe0\xb7-\x0c!1\xc3\x92\xd5\x1b\xc5\x82\x07n\x83x\xed\xdecX\xf80'
>>> print utf9.utf9decode(encoded)
ႹЄLᒪo, 🌍ǃ.. _RFC4042: https://www.ietf.org/rfc/rfc4042.txt