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

# pip3 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.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: surrogates-1.0.2.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/42.0.1 requests-toolbelt/0.9.1 tqdm/4.23.3 CPython/3.6.9

File hashes

Hashes for surrogates-1.0.2.tar.gz
Algorithm Hash digest
SHA256 1d8437a20b63f2af11bc94da187ff299a1d8d9708d11a5d3ab04cba66248e81c
MD5 80c57accebf99191aa91825f9cea464d
BLAKE2b-256 626c78ee3d95ec9364f46ea5365d68e4e34a2ebde3d9ddba58cfab5140514e02

See more details on using hashes here.

File details

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

File metadata

  • Download URL: surrogates-1.0.2-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/42.0.1 requests-toolbelt/0.9.1 tqdm/4.23.3 CPython/3.6.9

File hashes

Hashes for surrogates-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5f9e5e3bd49c2d437a0e70858e73df0e470c42d156d8f59de45efc680f1e92f0
MD5 e8f9e588dfd01c23e8691a0cb5d95e5d
BLAKE2b-256 2470f4849e93aa4d2da4045a639ae5af43abe7171c4f79d9bb7556ca8326b44b

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