Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5058184

Problems with encoders for IBM933, IBM949, IBM949C, IBM970

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 5.0
    • core-libs

      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

            sherman Xueming Shen
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: