-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.2.0, 1.2.2
-
generic, x86
-
generic, windows_nt
Name: bb33257 Date: 12/23/98
The CharToByte converters for Cp939. Cp930. Cp933, Cp935,
and Cp937 all throw an InternalError exception in certain
circumstances. Here's a sample:
import java.io.*;
public class HostDBCS {
public static void main(String argv[]) throws Exception {
try {
/* HOST DBCS Cp939, Cp930, Cp933, Cp935, Cp937 */
String encoding = "Cp939";
String inStr = "\uff21"; /* Unicode FULLWIDTH A */
String outStr = null;
byte[] inByte = new byte[3];
byte[] outByte = null;
inByte[0] = (byte) 0x0e; /* EBCDIC DBCS A */
inByte[1] = (byte) 0x42; /* EBCDIC DBCS A */
inByte[2] = (byte) 0xc1; /* EBCDIC DBCS A */
outStr = new String(inByte, 0, 3, encoding);
String s = Integer.toHexString(outStr.charAt(0)).toUpperCase();
System.out.println("\noutStr=" + s);
outByte = inStr.getBytes(encoding);
s = "";
for (int i = 0; i < outByte.length; i++)
s += Integer.toHexString(outByte[i] & 0xff).toUpperCase();
System.out.println("\noutByte=" + s);
}
catch (Throwable e) {
System.err.println(e.getLocalizedMessage());
e.printStackTrace();
}
System.in.read();
}
}
The output from this program is:
outStr=FF21
Converter malfunction: sun.io.CharToByteCp939
java.lang.InternalError: Converter malfunction: sun.io.CharToByteCp939
at java.lang.String.getBytes(String.java:629)
at java.lang.String.getBytes(String.java:659)
at HostDBCS.main(Compiled Code)
I'm running JDK 1.2 final on Windows NT 4.0, but I suspect that
this problem occurs on other platforms as well.
======================================================================
- duplicates
-
JDK-4232525 Cp930 codeset converter throws InternalError
-
- Closed
-
-
JDK-4232536 Cp935 throws InternalError when converting from Unicode
-
- Closed
-
-
JDK-4232562 Cp939 throws InternalError when converting from Unicode
-
- Closed
-
-
JDK-4251380 String.getBytes() fails
-
- Closed
-
-
JDK-4199599 Cp930 and Cp939 converters have problems with ITAIJI chars
-
- Resolved
-