JDK-4216927 : corrupted ConnectException message on Japanese Solaris
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.6
  • CPU: sparc
  • Submitted: 1999-03-03
  • Updated: 2002-03-01
  • Resolved: 2002-03-01
Related Reports
Duplicate :  
Description

Name: dbT83986			Date: 03/03/99


ConnectException displays corrputed text on Japanese Solaris.
The followings are sample code and console log.

I guess that:
Solaris native code does not encode the localized message that strerr() returns.
On Windows-J, it dispays the message in English, the message is hard-coded in Windows native code.

//////////////////////////////////////////////
import java.net.*;
class exceptionTest {
	public static void main (String[] arg) {
	    int port = 9898; // bogus port
	    try {
	        Socket s = new Socket("localhost", port);
	     } catch (Exception e) {
	         System.out.println(e);
		 e.printStackTrace();
	     }
	}
}
//////////////////////////////////////

java.net.ConnectException: ??????????????????
java.net.ConnectException: ??????????????????
        at java.net.PlainSocketImpl.doConnect(Compiled Code)
        at java.net.PlainSocketImpl.connectToAddress(Compiled Code)
        at java.net.PlainSocketImpl.connect(Compiled Code)
        at java.net.Socket.<init>(Compiled Code)
        at java.net.Socket.<init>(Compiled Code)
        at exceptionTest.main(Compiled Code)
(Review ID: 49029)
======================================================================

Comments
EVALUATION I think the general issue is that the exception reason strings in the JDK/JRE have not been localized. This is not specific to ConnectionException but applies generally to all Exception classes thrown by the core JRE implementation. jeff.nisewanger@Eng 1999-03-16 Issue has been escalated as 4258198 for 1.4.1_02 and will also be putback to hopper. ###@###.### 2002-03-01
16-03-1999