What is the best way to validate international domain names in Go?
https://golang.org/pkg/net/?m=all#isDomainName
https://golang.org/src/net/dnsclient.go?s=3444:3476#L109
Maybe copying this function which isn't exported from net package?
We need to validate domains like icaan.org and example.(special characters)
EDIT: IDN https://en.wikipedia.org/wiki/Internationalized_domain_name
Already using govalidator which fails to validate IDN's as it doesn't handle unicode characters https://github.com/asaskevich/govalidator/blob/master/validator.go
Here are some examples of IDN's
- https://evertpot.com/internationalized-domain-names-are-you-ready/
- http://مثال.إختبار - Arabic.
- http://例子.测试 - Chinese (simplified)
- http://例子.測試 - Chinese (traditional)
- http://παράδειγμα.δοκιμή - greek
- http://उदाहरण.परीक्षा Hindi
- http://例え.テスト - Japanese
- http://실례.테스트 - Korean
- http://مثال.آزمایشی - Persian
- http://пример.испытание - Russian
Just seen the reference to punycode.
Though all these punycode's are in the public suffix list https://publicsuffix.org/list/public_suffix_list.dat
:(