mathiasbynens / punycode.js

A robust Punycode converter that fully complies to RFC 3492 and RFC 5891.
https://mths.be/punycode
MIT License
1.6k stars 159 forks source link

Decoding email adresses #27

Closed rainboxx closed 9 years ago

rainboxx commented 9 years ago

Either there's a bug in the readme or in toUnicode. With version 1.3.2, this doesn't produce what's promised:

punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq');
// should be → 'джумла@джpумлатест.bрфa'
// will be → 'джумла@xn--p-8sbkgc5ag7bhce.bрфa'

Also:

punycode.toUnicode('bar@xn--mlaut-jva.de');
// should be → 'bar@ümlaut.de'
// will be → 'bar@xn--mlaut-jva.de'

while

punycode.toUnicode('xn--mlaut-jva.de');
// should be → 'ümlaut.de'
// will be → 'ümlaut.de'

Am I missing something? As mentioned in #20 and committed in 92f8796, email addresses should be decoded without splitting them up manually (AFAIU).

mathiasbynens commented 9 years ago

I am getting the expected results in v1.3.2.

What environment are you testing in? Are you sure you’re testing v1.3.2? What does punycode.version return?

rainboxx commented 9 years ago

Dammit, I ignored the fact that punycode is also a core module and didn't reference the module explicitly... Thanks for pointing me to (the obvious) punycode.version and sorry to waste your time!