ypcrts / fqdn

RFC-compliant FQDN validation and manipulation for Python.
http://fqdn.readthedocs.io/
Mozilla Public License 2.0
30 stars 11 forks source link

Constructor should encode Unicode input as Punycode #12

Open ypcrts opened 4 years ago

ypcrts commented 4 years ago

Goal: implement RFC3492 https://tools.ietf.org/html/rfc3492

In the constructor, Unicode input should be encoded as Punycode.

TODO:

wakemaster39 commented 4 years ago

I think saving some sanity and dropping python 2 is a smart move. The last release ever is done now and officially retired as of Jan 1. I am a hard ass on this one though and trying to force people off of legacy python.

https://pypi.org/project/idna/ this one might solve both the python2.7 problem and make life a little easier. Saves having to figure out striping - off the end of strings if they are only ascii characters "test.com".encode('punycode') -> test.com-

Need to be careful with cached properties and how do you extract the original form of the URL if thats something that needs supporting.