https://github.com/wimglenn/all-escapes
Codec for binary escapes
https://github.com/wimglenn/all-escapes
Last synced: 4 months 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 (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-22T07:46:47.000Z (almost 5 years ago)
- Last Synced: 2025-02-20T04:36:20.129Z (5 months 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!'