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

(cs) Merlin doesn't recognize a single byte 0300 is an incomplete UTF8 sequence

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.4.0
    • core-libs
    • x86
    • windows_nt

      J:\jtest>java -version
      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b60)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b60, mixed mode)

      Steps to Reproduce :

      Consider the following program:

      import java.io.*;
      public class IncSeq {
          public static void main(String[] args){
              try {
                  byte[] bb = new byte[] {(byte)0300};
                  ByteArrayInputStream inp = new ByteArrayInputStream(bb);
                  InputStreamReader ist = new InputStreamReader(inp,"UTF8");
                  ist.read();
              } catch (Throwable t){
                  System.out.println(t);
              }
          }
      }

      when the program is run with java 1.2/3/3.1, it prints:

      J:\jtest>java IncSeq
      sun.io.MalformedInputException

      when it is run with java 1.4 it prints nothing. I.e. it does not
      recognize the a single byte 0300 (i.e. 0xc0) is an incomplete UTF8
      sequence.

            mr Mark Reinhold
            mzaudousunw Menasse Zaudou (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: