From URI to IRI, in just one version

by Michael S. Kaplan, published on 2007/02/09 06:01 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2007/02/09/1632443.aspx


The question was:

Hi All – when I pass dns name in non-english I get this error: Is DNS names in non-english not supported?

I passed as DNS name: அம்மா

Cannot marshal: Encountered unmappable character.
  at System.Net.UnsafeNclNativeMethods.SafeNetHandlesXPOrLater.getaddrinfo(String nodename, String servicename, AddressInfo& hints, SafeFreeAddrInfo& handle)
   at System.Net.Dns.GetAddrInfo(String name)
   at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
   at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)

The answer immediately came to me -- the IdnMapping class, which uses RFC 3490 to provide International Domain Name strings.....

Now this answer immediately stopped me and made me wonder -- why doesn't the System.Net.Dns class use IdnMapping to return its answers?

Well, it turns out that the next version of the .Net Framework will handle IRIs (International Resource Identifiers, the standard to define Unicode characters in URIs per RFC 3987....

Anit Paka posted about this update last October right here, revealing some hints as to how this will work in terms of preserving backcompat and supporting the new functionality.

Very cool, and also very useful!

 

This post brought to you by  (U+0b85, a.k.a. TAMIL LETTER A)


no comments

go to newer or older post, or back to index or month or day