[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [idn] UTF-8 / RACE
- To: idn@ops.ietf.org
- Subject: Re: [idn] UTF-8 / RACE
- From: "Adam M. Costello" <amc@cs.berkeley.edu>
- Date: Tue, 29 May 2001 05:23:22 +0000
- Delivery-date: Mon, 28 May 2001 22:26:26 -0700
- Envelope-to: idn-data@psg.com
- User-Agent: Mutt/1.3.17i
"D. J. Bernstein" <djb@cr.yp.to> wrote:
> The question was why, in http://cr.yp.to/proto/idn.html, I listed
> gethostbyname() as something to be upgraded as part of the ACE solution.
I don't think it was me who asked that question.
> The answer is that ACE conversion has to happen somewhere between the
> user's command lines and the DNS packets. Changing the gethostbyname()
> code is easier than changing every program that uses gethostbyname().
I am willing to entertain the notion that changing gethostbyname() may
be a good idea. It has been argued that existing programs do not expect
to get non-ASCII text back from gethostbyname(), and I buy that argument
to some extent: If a program passes an ASCII name to gethostbyname(),
then gethostbyname() should not return any non-ASCII text (not even
if the ASCII name turns out to be an alias for an IDN), unless the
program has somehow explicitly invited non-ASCII text. But if a program
passes non-ASCII text to gethostbyname(), and is surprised to get
non-ASCII text back, it's arguably the program's fault. Perhaps passing
non-ASCII text to gethostbyname() should be considered permission for
gethostbyname() to return non-ASCII text.
If gethostbyname() receives 8-bit text, should it assume that it's
UTF-8, or should it assume that it's in the encoding of the current
locale? My gut feeling is the latter. And of course gethostbyname()
should use the same encoding for both the argument and the return value.
AMC