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 IDN and EAI email addresses #6

Open
jcranmer opened this issue Apr 3, 2014 · 2 comments
Open

Add support for IDN and EAI email addresses #6

jcranmer opened this issue Apr 3, 2014 · 2 comments

Comments

@jcranmer
Copy link
Contributor

jcranmer commented Apr 3, 2014

IDN and EAI are very complicated to handle properly. In keeping with the spirit of the API, jsmime should shield clients from the complexity to the maximum extent possible (this ought to include APIs that indicate whether or not two APIs are equivalent, for example).

The hard part here is getting reliable APIs for normalization and IDNA: String.prototype.normalize is added in ES6 (but as yet unimplemented in any engine), and there is no JS library that satisfies IDNA2003, IDNA2008, or IDNA-as-used-in-the-browser requirements. The URL specification has aspirations to include IDN helper functions, but API design here is blocked on getting some fixes in UTS#46.

@peteroupc
Copy link

Can you take a look at this?

https://github.com/peteroupc/IdnaJS

This is my JavaScript implementation of Unicode normalization and IDNA 2008. I hope this is of use to you.

@jcranmer
Copy link
Contributor Author

jcranmer commented May 7, 2014

What a coincidence, I was just working my way through this right now. :-)

I was planning on using String.prototype.normalize to handle normalization where necessary (it appears to have landed in both v8 and SpiderMonkey in the past month or so) and relying on polyfills for older browsers there.

IDN handling is much more complicated, since I need to think through the best way to mitigate Unicode homograph attacks, persistent storage issues, and IDNA2003/IDNA2008/UTS#46 mismatches.

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