Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VerifyDnsLength support #135

Closed
Gallaecio opened this issue Nov 15, 2022 · 3 comments
Closed

VerifyDnsLength support #135

Gallaecio opened this issue Nov 15, 2022 · 3 comments

Comments

@Gallaecio
Copy link

I have written a Python implementation of the URL living standard, and I would like to rely on idna for the Unicode Technical Standard #46 ToASCII implementation, rather than implementing my own from scratch.

From what I can tell, idna.encode aims to provide that implementation. But I have found that it behaves as if VerifyDnsLength was set to True (e.g. it complains about empty labels), while the URL living standard requires the call to set VerifyDnsLength to False, among other parameter choices.

Would it be OK if I open a pull request to extend this function to support VerifyDnsLength as an input parameter, and maybe also some of the other parameters not currently in the implementation? (if also needed to comply with the URL living standard)

@kjd
Copy link
Owner

kjd commented Nov 15, 2022

Without commenting on whether this is the right solution, I am happy to entertain adding optional parameters that modify behaviour in this manner if there are applications that need it.

I am not sure I understanding the underlying use case of permitting, say, example..com (i.e. with a zero length label between two separators) or a label or domain that is too big to fit in the DNS.

@Gallaecio
Copy link
Author

I am starting to realize that IDNA’s encode ≠ Unicode Technical Standard #46’s ToASCII, and that maybe trying to make idna.encode compatible with UTS46’s ToASCII would “soil” the API and implementation of idna.encode, making it harder to maintain.

@Gallaecio
Copy link
Author

OK, I think it makes sense to keep the idna implementation as it is, based on the IDNA specification, not on UTS46.

I will go for a separate implementation faithful to UTS46, to keep in line with the URL living standard and support emoji domains as long as the URL living standard does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants