-
Bug
-
Resolution: Fixed
-
P4
-
1.4.0
-
hopper
-
generic
-
generic
-
Verified
Name: pa48320 Date: 02/07/2002
CharToByteBig5_HKSCS needs to have mapping from Unicode 2.1 code points to HKSCS for backward compatibility.
http://www.info.gov.hk/digital21/eng/hkscs/download/big5-iso.txt
An example shown as the following diagram.
ByteToCharBig5_HKSCS CharToByteBig5_HKSCS
0xfa45 --------------------> U+42b5 ---------------------> 0xfa45
U+e005 --(this is missing)--> 0xfa45
The following test case returns "fa,45" in JDK 1.3.1 and "37" (a question mark) in JDK 1.4.0-rc.
########## code ##########
import java.util.*;
import java.io.*;
import java.lang.*;
class chatToByte {
public static void main(String args[]) throws UnsupportedEncodingException
{
try
{
String str = "\ue005";
String enc = "Big5_HKSCS";
byte b[] = str.getBytes(enc);
for (int i = 0; i < b.length; i++)
{
if (i == b.length - 1)
{
System.out.print(Integer.toHexString(((int)b[i]) & (0xff)) + "\n");
} else {
System.out.print(Integer.toHexString(((int)b[i]) & (0xff)) + ",");
}
}
} catch (UnsupportedEncodingException e) {
}
}
}
(Review ID: 139342)
======================================================================