Open hnakamur opened 7 years ago
This looks reasonable; at this point I would just mail the patch for review (people usually don't look at patches on the issue tracker).
Thanks for your comment.
I ran git change
and git mail
.
https://go-review.googlesource.com/c/38284/
This is now supported if you use any of the non-default profiles, which use the UTS #46 mappings pre-split so will normalize the dots any many other things you should do for proper IDNA support.
Would this be sufficient or should one also allow splitting on dots when one is using the raw Punycode profile?
@mpvl Thanks for your comment. I've updated the test case.
https://go-review.googlesource.com/c/38284/#message-4bfc92dfa0159b20d2bd3cdf1d7249a1c324fc33
Would this be sufficient or should one also allow splitting on dots when one is using the raw Punycode profile?
After reading the https://tools.ietf.org/html/rfc3490#section-4, I think we must normalize dots in raw Punycode profile. Also also the Registration profile must normalize dots instead of returning an error like idna: disallowed rune U+006A
.
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?What did you do?
Passed a string
"example\u3002jp"
toToASCII()
.What did you expect to see?
The return value is
"example.jp"
What did you see instead?
The return value was
"xn--examplejp-ck3h"
https://tools.ietf.org/html/rfc3490#section-3.1
I created a fix and add test cases at https://github.com/hnakamur/net/commit/bd2fe133f3df97090c43d065b739774b900f67c9 I also followed the steps at Contribution Guide - The Go Programming Language and am ready to run
git mail
if this fix looks good to reviewers.Thanks!