[getdns-api] Remove IDNA functions from getdns?

Willem Toorop willem at nlnetlabs.nl
Fri Sep 4 09:35:28 UTC 2015


Thank you Joe,

Yes, the getaddrinfo approach is precisely what I meant.  I.e.
extensions are to getdns what flags are to getaddrinfo.  Andrew & Paul,
do you still think that approach would be too complex for the typical
programmer?  If getaddrinfo is doing it this way, why shouldn't we?

-- Willem

Op 03-09-15 om 22:57 schreef Joe Hildebrand (jhildebr):
> I think the current IDN API may be at the wrong level of granularity.  I want to be able to pass in a UTF-8 encoded domain name, and have the library do whatever conversions are needed, like getaddrinfo does (now):
> 
>>From http://man7.org/linux/man-pages/man3/getaddrinfo.3.html :
> 
>    Extensions to getaddrinfo() for Internationalized Domain Names
>        Starting with glibc 2.3.4, getaddrinfo() has been extended to
>        selectively allow the incoming and outgoing hostnames to be
>        transparently converted to and from the Internationalized Domain Name
>        (IDN) format (see RFC 3490, Internationalizing Domain Names in
>        Applications (IDNA)).  Four new flags are defined:
> 
>        AI_IDN If this flag is specified, then the node name given in node is
>               converted to IDN format if necessary.  The source encoding is
>               that of the current locale.
> 
>               If the input name contains non-ASCII characters, then the IDN
>               encoding is used.  Those parts of the node name (delimited by
>               dots) that contain non-ASCII characters are encoded using
>               ASCII Compatible Encoding (ACE) before being passed to the
>               name resolution functions.
> 
>        AI_CANONIDN
>               After a successful name lookup, and if the AI_CANONNAME flag
>               was specified, getaddrinfo() will return the canonical name of
>               the node corresponding to the addrinfo structure value passed
>               back.  The return value is an exact copy of the value returned
>               by the name resolution function.
> 
>               If the name is encoded using ACE, then it will contain the
>               xn-- prefix for one or more components of the name.  To
>               convert these components into a readable form the AI_CANONIDN
>               flag can be passed in addition to AI_CANONNAME.  The resulting
>               string is encoded using the current locale's encoding.
> 
>        AI_IDN_ALLOW_UNASSIGNED, AI_IDN_USE_STD3_ASCII_RULES
>               Setting these flags will enable the IDNA_ALLOW_UNASSIGNED
>               (allow unassigned Unicode code points) and
>               IDNA_USE_STD3_ASCII_RULES (check output to make sure it is a
>               STD3 conforming hostname) flags respectively to be used in the
>               IDNA handling.
> 
> 




More information about the spec mailing list