JDK-4333733 : unix: method String.getBytes(String enc) throws java.lang.InternalError
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio.charsets
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: linux,solaris_7
  • CPU: x86,sparc
  • Submitted: 2000-04-27
  • Updated: 2001-07-19
  • Resolved: 2001-07-12
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
1.4.0 betaFixed
Related Reports
Relates :  
Description

Name: asR10013			Date: 04/27/2000


    The following code demonstrates unexpected behavior of the JVM. 
Exception java.lang.InternalError is thrown as a result of method 
String.getBytes invocation on line 4.

------------------------ test.java -----------------------------------
1 class test {
2     public static void main(String args[]) throws Exception {
3 	String s = "\u3000";
4 	byte[] ba = s.getBytes("Cp933");
5     }
6 }
-------------------------- output ------------------------------------
$ java -version
java version "1.3.0beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0beta-b01)
Classic VM (build 1.3.0beta-b01, green threads, nojit)
$ java test
Exception in thread "main" java.lang.InternalError: Converter malfunction: sun.io.CharToByteCp933
        at java.lang.String.getBytes(String.java:633)
        at java.lang.String.getBytes(String.java:665)
        at test.main(test.java:4)
----------------------------------------------------------------------

    The same results are observed under linux java version "1.2.2",
Solaris java version "1.2.2" and Solaris java version "1.3.0rc3".
    
======================================================================

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

EVALUATION To encode this single character in Cp933 requires 4 bytes - 2 bytes plus a shift-in and shift-out character. getMaxBytesPerChar() needs to be changed to return 4 since this is the max byte occupation for a general single char for this encoding. --Ian.Little@Ireland 10/19/2000
19-10-2000