RE: IDNA and getnameinfo() and getaddrinfo()

Shawn Steele <Shawn.Steele@microsoft.com> Tue, 15 June 2010 16:58 UTC

Return-Path: <Shawn.Steele@microsoft.com>
X-Original-To: idna-update@alvestrand.no
Delivered-To: idna-update@alvestrand.no
Received: from localhost (localhost [127.0.0.1]) by eikenes.alvestrand.no (Postfix) with ESMTP id 413B439E278 for <idna-update@alvestrand.no>; Tue, 15 Jun 2010 18:58:31 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at eikenes.alvestrand.no
Received: from eikenes.alvestrand.no ([127.0.0.1]) by localhost (eikenes.alvestrand.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r71BP7fe9IY6 for <idna-update@alvestrand.no>; Tue, 15 Jun 2010 18:58:21 +0200 (CEST)
X-Greylist: domain auto-whitelisted by SQLgrey-1.6.8
Received: from smtp.microsoft.com (mailb.microsoft.com [131.107.115.215]) by eikenes.alvestrand.no (Postfix) with ESMTPS id F330339E0FC for <idna-update@alvestrand.no>; Tue, 15 Jun 2010 18:58:20 +0200 (CEST)
Received: from TK5EX14MLTC103.redmond.corp.microsoft.com (157.54.79.174) by TK5-EXGWY-E802.partners.extranet.microsoft.com (10.251.56.168) with Microsoft SMTP Server (TLS) id 8.2.176.0; Tue, 15 Jun 2010 09:58:19 -0700
Received: from TK5EX14MBXC139.redmond.corp.microsoft.com ([169.254.7.48]) by TK5EX14MLTC103.redmond.corp.microsoft.com ([157.54.79.174]) with mapi id 14.01.0160.007; Tue, 15 Jun 2010 09:58:17 -0700
From: Shawn Steele <Shawn.Steele@microsoft.com>
To: Nicolas Williams <Nicolas.Williams@oracle.com>
Subject: RE: IDNA and getnameinfo() and getaddrinfo()
Thread-Topic: IDNA and getnameinfo() and getaddrinfo()
Thread-Index: AQHLDKTtM8f7jBMxfE2iSEeA/3DnEpKDsf6A//+Lo2Y=
Date: Tue, 15 Jun 2010 16:54:46 +0000
Message-ID: <E14011F8737B524BB564B05FF748464A0D9F846D@TK5EX14MBXC139.redmond.corp.microsoft.com>
References: <E14011F8737B524BB564B05FF748464A0D9F834C@TK5EX14MBXC139.redmond.corp.microsoft.com>, <20100615165113.GH24077@oracle.com>
In-Reply-To: <20100615165113.GH24077@oracle.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Cc: "idna-update@alvestrand.no" <idna-update@alvestrand.no>
X-BeenThere: idna-update@alvestrand.no
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: IDNA update work <idna-update.alvestrand.no>
List-Unsubscribe: <http://www.alvestrand.no/mailman/options/idna-update>, <mailto:idna-update-request@alvestrand.no?subject=unsubscribe>
List-Archive: <http://www.alvestrand.no/pipermail/idna-update>
List-Post: <mailto:idna-update@alvestrand.no>
List-Help: <mailto:idna-update-request@alvestrand.no?subject=help>
List-Subscribe: <http://www.alvestrand.no/mailman/listinfo/idna-update>, <mailto:idna-update-request@alvestrand.no?subject=subscribe>
X-List-Received-Date: Tue, 15 Jun 2010 16:58:31 -0000

We're in agreement, I think.  I'd rather have IDN work for getname, etc. by default though.  (Then maybe it'd "just work"?)  Instead of ToUnicode(), which is very specific, I'd prefer a more general "GetPrettyDNSName()."  Then, if more steps than just ToUnicode() are ever interesting, the gory details are hidden from the app.  Specifially, on machines hosting both UTF-8 (or other code page) and Punycode DNS, the actual form of "pretty" could differ depending on how a name was looked up.

For email, at least, UTF8SMTP is much smarter.  The DNS layer is muddy still, but at least the addresses are "just utf-8", and don't get to this state of having strange encodings leaking all over the place.

-Shawn

 
http://blogs.msdn.com/shawnste


________________________________________
From: idna-update-bounces@alvestrand.no [idna-update-bounces@alvestrand.no] on behalf of Nicolas Williams [Nicolas.Williams@oracle.com]
Sent: Tuesday, June 15, 2010 9:51 AM
To: Shawn Steele
Cc: idna-update@alvestrand.no
Subject: Re: IDNA and getnameinfo() and getaddrinfo()

On Tue, Jun 15, 2010 at 04:09:13PM +0000, Shawn Steele wrote:
> FWIW: I don't think that applications should need to understand how
> DNS works.  (Something of a seperation of business logic concept as
> probably taught in, like, CS101 - "Don't make your app know more than
> it has to.")  IMO it'd be nice if app developers that need to open a
> connection to a server had all the Punycode ugliness layered away by
> some nice set of DNS APIs, or even higher level at the open connection
> APIs or whatever.

Simon's extensions for getname/addrinfo() are the kind of APIs I'm
looking for.  I'm not sure if that's what you have in mind, but I'd love
to hear about it.

> Unforunately, Punycode means that some apps will want to decode the
> string anyway because they'd like pretty names.  Some sort of
> getcanonicalname() or something could help there.  I realize there's
> an "A" in "IDNA", but if every app has to do punycode conversion
> themselves there's going to be tons of odd inconsistencies in what
> they're doing.  It could also mean "tweaking" thousands of apps if the
> IDNA20xx rules change a little.  (Eg: like the bidi rules did this go
> around).

If an application is just dealing with hostnames then it's easy:
ToUnicode().  If the application needs hostname<->IP address resolution
then it needs something more like getname/addrinfo() with suitable
enhancements.  If the application needs to deal with e-mail addresses,
IRIs, etcetera, then the application is going to need APIs that are
specific to those.  The alternative is that the application must
implement all the relevant rules, all the time, and as draft-iab-idn-
encoding explains, that isn't always possible (the example being the
name service switch in typical operating systems).  It will be better to
have context-specific APIs.

> The good thing about Punycode/IDN is that it enabled DNS.  The bad
> thing is that suddenly any network app needs to become a DNS expert.

To some degree that's unavoidable, but with context-specific APIs we can
minimize the burden on applications.  We should do just that if we want
IDNA to succeed beyond the web browser (do we?).

Nico
--
_______________________________________________
Idna-update mailing list
Idna-update@alvestrand.no
http://www.alvestrand.no/mailman/listinfo/idna-update