Subject: RE: [idn] UTF-8 / RACE

From: Yves Arrouye <[email-masked]>
Date: Thu, 31 May 2001 23:24:32 -0700

> 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.

It is very unlikely that gethostbyname() or any other function would be able
to make that determination except in simplistic cases. Many operating-system
provided locale models are not thread-safe, and threaded applications then
use other mechanisms that the OS may not be aware of. Internationalization
libraries, as another example, commonly provide their own locale model and
applications will use the library's rather than the OS.

So some encoding transformations will have to be done by the application.
Which does not mean that it may not be a good idea to change gethostbyname()
in some way, for Nameprep for example. I just doubt that one can achieve
full transparency in this case, unfortunately. Applications will need to be
changed.

YA

---

From: Keith Moore <[email-masked]>
Date: Fri, 01 Jun 2001 10:40:45 -0400

yet another reason why trying to overload gethostbyname() is a bad idea.