Skip to main content

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


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 details)

Uploaded Source

Built Distribution

surrogates-1.0.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file surrogates-1.0.1.tar.gz.

File metadata

  • Download URL: surrogates-1.0.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.23.3 CPython/3.6.8

File hashes

Hashes for surrogates-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e8b1b58dac2da38e4ee7a06c2ab307ffdcdc60db4ee181d4ec3b9cff424273d6
MD5 f0228221fc6a185ce7887404e9b8dc81
BLAKE2b-256 50322eef99ab18cd249296d009c77a6781d80a911b849dcb6cb6e5cf22e0e581

See more details on using hashes here.

File details

Details for the file surrogates-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: surrogates-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.23.3 CPython/3.6.8

File hashes

Hashes for surrogates-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3eeea6bbc4d8325e471dbc608ea81f3f9c5863af820fc0c2f579c9cc20c26510
MD5 3d2f40156335b58f0763bca8db97cb73
BLAKE2b-256 df451632bf76fc800c18800d589ae835d84c6519b7b7f333dc4b51897f66c8ad

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