Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wimglenn/all-escapes

Codec for binary escapes
https://github.com/wimglenn/all-escapes

Last synced: 3 days ago
JSON representation

Codec for binary escapes

Awesome Lists containing this project

README

        

all-escapes
-----------

Registers a codec for representing binary escapes in text domain.

.. code-block:: python

>>> b"Hello, World!".decode("all-escapes")
'\\x48\\x65\\x6c\\x6c\\x6f\\x2c\\x20\\x57\\x6f\\x72\\x6c\\x64\\x21'

>>> r"\x48\x65\x6c\x6c\x6f\x2c\x20\x57\x6f\x72\x6c\x64\x21".encode("all-escapes")
b'Hello, World!'