Open cor3ntin opened 5 years ago
There's a UAX for this.
http://www.unicode.org/reports/tr46/
See also:
http://www.unicode.org/reports/tr36/ http://www.unicode.org/reports/tr39/
Our responsibility here is to ensure that people can normalize and work with their text. The technical reports and security reports published by Unicode can be enforced by the people working on Networking using the appropriate tools.
Should they forget, we should gently remind them of such best practices.
At a glance, both windows and linux expect or support utf8 when doing dns query so we could provide only utf8 overload and make the conversions explicit
in the ts:
host_name()
-> returns charaddress::to_string()
-> returns char, dito for network_address
make_address
-> expects charbasic_resolver
and basic_resolver_entry
-> charI've come to the conclusion that there is probably 2 reasonable paths:
In both case allocation may be required, the behavior of non-ascii in the execution encoding methods should probably be undefined ( you can go from local to Unicode, not the other-way around)
That probably calls for actually implementation experience in any-case, lots of platform specific behavior
https://tools.ietf.org/html/rfc3492 https://tools.ietf.org/html/rfc5891
Need to be able to provide the ACE (ASCII-Compatible Encoding) form of the domain name. When interacting with third party APIs which don't support Unicode, this is the only compatible form.
Obviously it should always be accepted almost everywhere where Unicode is accepted too. There's one exception: when dealing with DNS-SD, since it uses direct UTF-8 instead of Punycode for encoding. A domain like "josé._ssh._tcp.josé.example.com" might encode as "jos\xc3\xa._ssh._tcp.xn--jos-dma.example.com".
Thanks for raising this issue, @cor3ntin. This does indeed look complicated.
Two thoughts:
In one form or another, WG21 will look at networking over the next few years. That will involve domain names.
We should discuss it at some point; It's a complicated topic.