-
Bug
-
Resolution: Fixed
-
P2
-
1.4.2_12
-
b01
-
b06
-
generic, sparc
-
generic, solaris_8
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2142960 | 5.0u11 | Kevin Walls | P3 | Resolved | Fixed | b03 |
UnicodeLittle is broken on 1.4.2_12, the following test fails on 1.4.2_12 and works on older versions such as 1.4.2_06:
public class TestUnicodeLittle {
public static void main(String[] args) throws Exception {
byte[] unicodeLittleBytes = new byte[]{68,0,83,0,75,0,80,0,79,0,79,0,76,0,53,0,51,0};
String unicodeLittleStr = new String(unicodeLittleBytes, "UnicodeLittle");
System.out.println("Actual output: " + unicodeLittleStr);
System.out.println("Expected output: DSKPOOL53");
if ("DSKPOOL53".equals(unicodeLittleStr)) {
System.out.println("Test passed");
} else {
System.out.println("Test failed");
}
}
}
Test output on 1.4.2_06:
$ java -version
java version "1.4.2_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode)
$ java -cp . TestUnicodeLittle
Actual output: DSKPOOL53
Expected output: DSKPOOL53
Test passed
$
Output on 1.4.2_12:
$ java -version
java version "1.4.2_12"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_12-b03)
Java HotSpot(TM) Client VM (build 1.4.2_12-b03, mixed mode)
$ java -cp . TestUnicodeLittle
Actual output: ?????????
Expected output: DSKPOOL53
Test failed
$
public class TestUnicodeLittle {
public static void main(String[] args) throws Exception {
byte[] unicodeLittleBytes = new byte[]{68,0,83,0,75,0,80,0,79,0,79,0,76,0,53,0,51,0};
String unicodeLittleStr = new String(unicodeLittleBytes, "UnicodeLittle");
System.out.println("Actual output: " + unicodeLittleStr);
System.out.println("Expected output: DSKPOOL53");
if ("DSKPOOL53".equals(unicodeLittleStr)) {
System.out.println("Test passed");
} else {
System.out.println("Test failed");
}
}
}
Test output on 1.4.2_06:
$ java -version
java version "1.4.2_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode)
$ java -cp . TestUnicodeLittle
Actual output: DSKPOOL53
Expected output: DSKPOOL53
Test passed
$
Output on 1.4.2_12:
$ java -version
java version "1.4.2_12"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_12-b03)
Java HotSpot(TM) Client VM (build 1.4.2_12-b03, mixed mode)
$ java -cp . TestUnicodeLittle
Actual output: ?????????
Expected output: DSKPOOL53
Test failed
$
- backported by
-
JDK-2142960 Regression: UnicodeLittle broken on 1.4.2_12
- Resolved
- duplicates
-
JDK-6477896 Two CTS i18n tests fail with jdk 1.4.2_12
- Closed
- relates to
-
JDK-6407730 UnicodeLittle is BIG-endian
- Resolved