Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/wimglenn/all-escapes
- Owner: wimglenn
- Created: 2020-09-20T05:01:34.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-22T07:46:47.000Z (over 4 years ago)
- Last Synced: 2024-11-18T04:22:15.904Z (about 1 month ago)
- Language: Python
- Size: 3.91 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
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!'