Convert DnsQuery_A to DnsQuery_W calls?

Corinna Vinschen corinna-cygwin@cygwin.com
Mon May 2 07:32:00 GMT 2011


On May  1 22:48, Pierre A. Humblet wrote:
> At 10:54 AM 5/1/2011, Corinna Vinschen wrote:
> >Hi Pierre,
> >
> >as you know Cygwin does not use the Windows ANSI codepage anymore, but a
> >multibyte encoding of the user's choice.  So we're only using native NT
> >functions and the UNICODE functions and convert to multibyte ourselves.
> >
> >Except for minires-os-if.c.  It's still using the DnsQuery_A function
> >rather than DnsQuery_W.  My question is, does it make sense to convert
> >minires-os-if.c to use DnsQuery_W?  Up until a short while back, all
> >DNS data was ASCII-only anyway, but now that internationalized domains
> >exist, isn't it the right thing to do to use DnsQuery_W?
> 
> Hi Corinna,
> 
> Why not!  After all DnsQuery_A calls DnsQuery_W.
> 
> But it's not clear the me what that buys us. IDNA stands for
> Internationalized Domain Names for APPLICATIONS.
> 
> If you look at the diagram at the top of section 6 of  RFC 3490
> (granted, it's obsolete) the calls to/from the resolver are always in
> ACE (ascii). The translation onus is on the application.

I had a look into the more recent RFC 5891 and it appears that the
strings are still stored as ASCII-only, as xn--<punycode>.  And the
translation onus is still on the application.

> Put another way, has the res_ interface been extended (or replaced) to
> support unicode? If so we should definitely support such an extension
> (or replacement).

No, it doesn't appear as if the resolver API has to be changed.

> However even that does not necessarily imply there is a benefit to
> using DnsQuery_W!
> As dns records are in ascii "on the wire", the key question is whether
> DnsQuery_W performs Punycode encoding/decoding (RFC 3492) or if it just
> expects/provides unicode encoded ascii (possibly already Punycoded).
> Clearly DnsQuery_A would not do such encoding/decoding, and I don't
> expect the _A and _W versions of DnsQuery to behave so differently.
> Am I wrong?

I honestly don't know.  You say that DnsQuery_A does not do any
conversions.  However, I was concerned that DnsQuery_A would
perform character conversions from an IDN to the current ANSI codepage.
I just searched MSDN and from what I can see, it's also the
applications responsibility to call new functions like IdnToAscii
and stuff.

So, never mind, let's stick to DnsQuery_A until somebody actually
complains about some misbehaviour with an IDN name.  Actually,
if that really ever happens, not only DnsQuery_A, but also
getaddrinfo/getnameinfo would be affected.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat



More information about the Cygwin-developers mailing list