JDK-4957669 : REGRESSION:create a socket with a Japanese hostname throws IllegalArgumentExcept
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 5.0
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2003-11-20
  • Updated: 2003-12-15
  • Resolved: 2003-12-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 b32Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
###@###.### 2003-11-20

J2SE Version (please include all output from java -version flag):

 java version "1.5.0-beta"
 Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b28)
 Java HotSpot(TM) Client VM (build 1.5.0-beta-b28, mixed mode)

Does this problem occur on J2SE 1.4 or 1.4.1 or 1.4.2?  Yes / No (pick one)

 No

Operating System Configuration Information (be specific):

 Windows XP


Bug Description:

 Creating a socket with a Japanese host name throws not 
 UnknownHostException but IllegalArgumentException.


Steps to Reproduce (be specific):

The following is the sample program to reproduce the problem. Just compile and run it:

import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;

class SocketTest {
    public static void main(String[] args) {
        try {
            Socket s = new Socket("\u67f4\u7530\u82b3\u6a39", 8000);
        } catch (UnknownHostException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}




Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic tiger-beta FIXED IN: tiger-beta INTEGRATED IN: tiger-b32 tiger-beta
14-06-2004

EVALUATION When the socket:// URI is created, the Japanese characters are accepted (although we need to change the assert false because it is surely possible for a URISyntaxException to happen in practice) It is allowed to use non-ascii characters in URI instances. The problem is that URI.getHost() is returning null. Looks like a URI bug. ###@###.### 2003-11-21
21-11-2003