JDK-6330854 : IRI/URI: Accessing the resource represented by IRI/URI instance doesn't work
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 6
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2005-09-29
  • Updated: 2017-08-25
Related Reports
Relates :  
Description
The following tests don't work with eng. nightly build.
http://www.w3.org/International/tests/sec-iri-3
http://www.w3.org/2001/08/iri-test/ (most tests on this page don't work)

According to Edward,
> Regarding name resolving against i18n uri/url, it's quite complicated. The URI class, which implements both RFC 3986 & 3987, is scheme agnostic. So scheme-specific behavior like name resolving for http scheme is out of scope of URI class. And the DNS infrastructure is still ASCII-only. That's what IDN class for. So one must do like this:
>     URI uri = ...;
>     InetAddress.getByName(IDN.toASCII(uri.getHost()));
> 
> But URL.openConnection() makes it even more complex. I think the example below is absolutely reasonable:
>     URI uri = ...;
>     HttpURLConnection conn = (HttpURLConnection)
>                  uri.toURL().openConnection();
>     conn.getResponseCode();
> It donesn't work for non-ASCII URI now. Just file a bug for that to me.

Comments
EVALUATION URI/IRI is scheme agnostic. So scheme-specific knowledge, e.g. a non-ASCII host name of an http URI should be converted into IDN form before hit DNS server, should be added into StreamHandler framework. It's a RFE; StreamHandler framework needs to be enhanced to embrace IDN conversion loginc.
30-09-2005