-
Bug
-
Resolution: Fixed
-
P3
-
5.0
-
b78
-
generic
-
generic
The following program demonstates problems with various encoders:
--------------------------------------------------
public class DebugEncoder {
public static void main(String[] args) throws Exception {
new String(new char[] {(char)Integer.parseInt(args[1], 16)})
.getBytes(args[0]);
}
}
--------------------------------------------------
The invocation "java DebugEncoder IBM933 1100" simply hangs in an
infinite loop.
For exceptions generated using other charsets, see below:
$ java DebugEncoder IBM949 dc00
Exception in thread "main" java.lang.IllegalArgumentException
at java.nio.Buffer.position(Buffer.java:218)
at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:581)
at java.lang.StringCoding$CharsetSE.encode(StringCoding.java:336)
at java.lang.StringCoding.encode(StringCoding.java:372)
at java.lang.String.getBytes(String.java:821)
at DebugEncoder.main(DebugEncoder.java:3)
$ java DebugEncoder IBM949c dc00
Exception in thread "main" java.lang.IllegalArgumentException
at java.nio.Buffer.position(Buffer.java:218)
at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:581)
at java.lang.StringCoding$CharsetSE.encode(StringCoding.java:336)
at java.lang.StringCoding.encode(StringCoding.java:372)
at java.lang.String.getBytes(String.java:821)
at DebugEncoder.main(DebugEncoder.java:3)
$ java DebugEncoder IBM970 8e
Exception in thread "main" java.lang.IllegalArgumentException
at java.nio.Buffer.position(Buffer.java:218)
at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:581)
at java.lang.StringCoding$CharsetSE.encode(StringCoding.java:336)
at java.lang.StringCoding.encode(StringCoding.java:372)
at java.lang.String.getBytes(String.java:821)
at DebugEncoder.main(DebugEncoder.java:3)
###@###.### 2004-06-06
--------------------------------------------------
public class DebugEncoder {
public static void main(String[] args) throws Exception {
new String(new char[] {(char)Integer.parseInt(args[1], 16)})
.getBytes(args[0]);
}
}
--------------------------------------------------
The invocation "java DebugEncoder IBM933 1100" simply hangs in an
infinite loop.
For exceptions generated using other charsets, see below:
$ java DebugEncoder IBM949 dc00
Exception in thread "main" java.lang.IllegalArgumentException
at java.nio.Buffer.position(Buffer.java:218)
at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:581)
at java.lang.StringCoding$CharsetSE.encode(StringCoding.java:336)
at java.lang.StringCoding.encode(StringCoding.java:372)
at java.lang.String.getBytes(String.java:821)
at DebugEncoder.main(DebugEncoder.java:3)
$ java DebugEncoder IBM949c dc00
Exception in thread "main" java.lang.IllegalArgumentException
at java.nio.Buffer.position(Buffer.java:218)
at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:581)
at java.lang.StringCoding$CharsetSE.encode(StringCoding.java:336)
at java.lang.StringCoding.encode(StringCoding.java:372)
at java.lang.String.getBytes(String.java:821)
at DebugEncoder.main(DebugEncoder.java:3)
$ java DebugEncoder IBM970 8e
Exception in thread "main" java.lang.IllegalArgumentException
at java.nio.Buffer.position(Buffer.java:218)
at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:581)
at java.lang.StringCoding$CharsetSE.encode(StringCoding.java:336)
at java.lang.StringCoding.encode(StringCoding.java:372)
at java.lang.String.getBytes(String.java:821)
at DebugEncoder.main(DebugEncoder.java:3)
###@###.### 2004-06-06
- relates to
-
JDK-5058133 iso2022 encoders throw BufferOverflowException
- Resolved
-
JDK-6454714 OutputStreamWriter writes incorrect number of characters to file with some IBM encodings
- Resolved