Surrogates
:relieved: Encode and decode pairs of surrogate characters in Python 3
Install / Use
/learn @hartwork/SurrogatesREADME
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
pip3 install pre-commit
pre-commit install --install-hooks
Related Skills
node-connect
352.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
claude-opus-4-5-migration
111.1kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
111.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
model-usage
352.0kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
