Encode and decode pairs of surrogate characters
Project description
Surrogates
surrogates
is a small, tested Python 3 package
to encode and decode pairs of
surrogate characters
in Python strings.
It is licensed under the MIT license.
Installation
# pip install --user surrogates
Usage
# python3 -m IPython
[..]
In [1]: import surrogates
In [2]: surrogates.encode('😘')
Out[2]: '\ud83d\ude18'
In [3]: surrogates.decode('\uD83D\uDE18')
Out[3]: '😘'
In [4]: hex(ord('😘'))
Out[4]: '0x1f618'
Develop & run tests
cd "$(mktemp -d)"
git clone https://github.com/hartwork/surrogates
cd surrogates/
python3 -m venv py3
source py3/bin/activate
./setup.py test
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
surrogates-1.0.1.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for surrogates-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3eeea6bbc4d8325e471dbc608ea81f3f9c5863af820fc0c2f579c9cc20c26510 |
|
MD5 | 3d2f40156335b58f0763bca8db97cb73 |
|
BLAKE2b-256 | df451632bf76fc800c18800d589ae835d84c6519b7b7f333dc4b51897f66c8ad |