[bug-inetutils] Re: Internationalized domain names teaser

"Martin v. Löwis" martin@v.loewis.de
Wed Jan 8 15:15:00 GMT 2003


Simon Josefsson wrote:
> ,----
> | Because these resolver libraries today expect only domain names in
> | ASCII, applications MUST prepare labels that are passed to the resolver
> | library using the ToASCII operation. Labels received from the resolver
> | library contain only ASCII characters; internationalized labels that
> | cannot be represented directly in ASCII use the ACE form. ACE labels
> | always include the ACE prefix.
> `----
> 
> I think the IDNA specification gives poor recommendations in this
> area, an area which doesn't even concern the IDNA protocol itself.

But this recommendation is irrelevant for gethostname (and likewise 
getaddrinfo). For ToASCII, the assumption is that the input is a 
sequence of Unicode characters. gethostname does not expect Unicode 
characters, but char*.

Taking the recommendation of IDNA literally, the C library should 
provide the ToASCII function, and it would be the application's task to 
use it. For C, of course, this means that the application needs a 
wchar_t* representation of the label. While this probably should be done 
as well, many applications will appreciate if there is some simpler API 
to access IDNA.

Regards,
Martin





More information about the Libc-alpha mailing list