mmriis / simpleidn

SimpleIDN ruby gem
MIT License
70 stars 14 forks source link

Conversion differing from other punycode conversion tools #15

Closed onli closed 6 years ago

onli commented 6 years ago

I'm trying to implement https://github.com/portier/portier.github.io/blob/master/specs/Email-Normalization.md in Ruby, which includes converting the domain of an email address to ASCII according to https://url.spec.whatwg.org/. I thought simpleidn would do this for me. But one of the provided test cases does not comply: İⅢ.example to_ascii converts to xn--bfa895n.example, while the test case expects xn--iiii-qwc.example. This is also what Firefox, https://github.com/mlocati/idna (PHP library), the node.js stdlib and the rust idna crate make out of İⅢ.example.

Is this a bug in this gem?

mmriis commented 6 years ago

So running the test suite fails for you?

onli commented 6 years ago

That's a simple rspec in the simpleidn maindir, no? No, that is all green. But the test cases provided by portier https://github.com/portier/portier-broker fail, https://github.com/portier/sinatra-portier/blob/4800005fbcd5ab74a047ef426739a66970124d6a/test/test_normalization.rb#L11. I got told that they do work when https://github.com/mmriis/simpleidn/pull/13 is applied (but I can't rely on a PR in a gem).

mmriis commented 6 years ago

Yeah. Ok. So that PR actually solved it. I'm going to focus on that, which is long overdue and close this issue.

onli commented 6 years ago

Thanks :)