Skip to content

frereit/bootstring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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")
'他们为什么不说中文'

About

A Python implementation of the bootstring algorithm (RFC3492)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages