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.
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.