Example code:
java.net.URI.create("http://测试.com").getHost(); // return null
new java.net.URL("http://测试.com").getHost(); // return "测试.com"
- Actual: URI doesn't resolve IRI
- Expected: both return "测试.com"
Related documents:
In javadoc of URI, it is mentioned that it supports:
other The Unicode characters that are not in the US-ASCII character set, are not control characters (according to the Character.isISOControl method), and are not space characters (according to the Character.isSpaceChar method) (Deviation from RFC 2396, which is limited to US-ASCII)
It is also well-known that
every URL is a URI, abstractly speaking, but not every URI is a URL.
So the behavior above doesn't seem to follow the expectation.
There used to be a RFE, but it seems to be reverted if I'd understood correctly.