|
Quick Lists
|
|
Bug ID:
|
4333733
|
|
Votes
|
0
|
|
Synopsis
|
unix: method String.getBytes(String enc) throws java.lang.InternalError
|
|
Category
|
java:char_encodings
|
|
Reported Against
|
kest-sol-beta
, kestrel-linux
|
|
Release Fixed
|
1.4(merlin-beta)
|
|
State
|
10-Fix Delivered,
Verified,
bug
|
|
Priority:
|
4-Low
|
|
Related Bugs
|
4296969
|
|
Submit Date
|
27-APR-2000
|
|
Description
|
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".
======================================================================
|
|
Work Around
|
N/A
|
|
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.
-- xxxxx@xxxxx 10/19/2000
|
|
Comments
|
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|
|
|
 |