Bootstring encoding and decoding (RFC 3492)
Project description
Python Bootstring
This is a Python implementation of the Bootstring encoding algorithm, as described in RFC 3492.
The Bootstring encoding algorithm is used to encode Unicode strings into ASCII strings, and is used by the Punycode encoding algorithm.
This implementation passes all the tests in the RFC 3492 test suite, however is is not optimized for performance and might fail on edge cases not covered by the test suite.
To use it, simply pip install git+https://github.com/frereit/bootstring/ and import bootstring:
>>> import bootstring
>>> bootstring.encode("hello, world!")
'hello, world!-'
>>> bootstring.decode("hello, world!-")
'hello, world!'
>>> bootstring.encode("döner")
'dner-5qa'
>>> bootstring.decode("dner-5qa")
'döner'
>>> bootstring.encode("他们为什么不说中文")
'ihqwcrb4cv8a8dqg056pqjye'
>>> bootstring.decode("ihqwcrb4cv8a8dqg056pqjye")
'他们为什么不说中文'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bootstring-1.0.1.tar.gz.
File metadata
- Download URL: bootstring-1.0.1.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3babe893dc0c0a0c9b3f785427036b4cbe5cc6b60493dee40af9eca6a8554ece
|
|
| MD5 |
9d211d5a67f53116acb2c6de8ec8bd0e
|
|
| BLAKE2b-256 |
4c38450e6c08c1e1b970904dfb11057ed805398b314773f278a231269b3af4ce
|
File details
Details for the file bootstring-1.0.1-py3-none-any.whl.
File metadata
- Download URL: bootstring-1.0.1-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5afa97c1647474b37f60683b5a5e8b62197d11a0913c79e3707bba4994cbc47a
|
|
| MD5 |
1568af9eaf08e381e7227e969228c0cd
|
|
| BLAKE2b-256 |
e41329c092ae3a35dcb61b1ea53288d97e6386e3cde78b420c0b3c8b70cefd2d
|