[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [idn] The layers and character handling in DNS




>Dan writes:
>> If I look at how I would like things to work, if could be like this:
>> 
>> user enters name in application using LOCAL character set.
>> ->
>> application calls routnes like: gethostbyname
>> ->
>> gethostbyname converts form LOCAL character set to 
>> normalised (not namepreped) UTF-8 (or other format).
>> it may reject the query if the name contains forbidden characters.
>> and sends the query to DNS server.
>
>How does gethostbyname() know for sure what the character set of its
>argument is?

In Unix from the current locale.

Paul said that this thread was having the mapping by the protocol. This
is not so, the protocol uses UCS, it is the API used by the application that
should map between the protocol format and local format. The APIs for
accessing DNS should not return protocol format, it should return the
native format used in applications.

It is the same for the API for LDAPv3. The LDAP protocol uses UTF-8, but
the strings returned by the calls should do the mapping for the
application.

  Dan