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

Add support for IDNA 2008 (RFC 5891) #819

Open
j-bernard opened this issue Nov 12, 2021 · 2 comments
Open

Add support for IDNA 2008 (RFC 5891) #819

j-bernard opened this issue Nov 12, 2021 · 2 comments

Comments

@j-bernard
Copy link

The tests have been conducted on Android SDK 30 with Fuel version 2.3.1.

With Fuel, URLs containing Unicode characters are converted using percent encoding but domain names should be converted as defined in RFC 5891.

On Android, the stack does it jobs and correctly performs IDNA conversion, replacing the percent encoding, but it follows an old standard IDNA 2003 (RFC 3490).

To be fully compliant, fuel should perform domain name conversion following IDNA 2008 standard.

This snippet does the conversion from U-label to A-label which is the form that should be provided to the network stack:

val idna = IDNA.getUTS46Instance(flags)
val info = IDNA.Info()
val sb = StringBuilder()
val domainAscii = idna.nameToASCII(domain, sb, info)
// check error with info.hasErrors()
@kittinunf
Copy link
Owner

Thanks for filing the issue! Do you think you can try to take a stab and open a PR to support this? Otherwise, I can try to see how to fix this later at the end of the week or something.

@j-bernard
Copy link
Author

I'll try to spend some time on it, maybe next week.

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

Successfully merging a pull request may close this issue.

2 participants