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

character encoding broken in merlin-beta b46 (win32)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P1 P1
    • None
    • 1.4.0
    • core-libs


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


      Operating System Configuration Information (be specific):
      NT 4.0 service pack 5

      Steps to Reproduce (be specific):

      Consider the following program:

      import java.io.*;
      public class Err11 {
          public static void main(String[] args) throws IOException {
              FileWriter out = new FileWriter("tmp.tmp");
              out.write("\u0000 s");
              out.close();
              FileReader inp = new FileReader("tmp.tmp");
              int c;
              do {
                  c = inp.read();
                  System.out.println(Integer.toHexString(c));
              } while (c >= 0);
          }
      }

      When executing it, it prints:

      J:\borsotti\jtest>java Err11
      3f
      73
      ffffffff

      I.e. the encoder replaces the Unicode character U+0000 by a question
      mark (3f), which could be appropriate for the encoding Cp1252,
      but it removes the space character which is present after it.
      The space character must instead be written to the file.

            ilittlesunw Ian Little (Inactive)
            mzaudousunw Menasse Zaudou (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: