-
Bug
-
Resolution: Duplicate
-
P1
-
None
-
1.4.0
-
generic
-
windows_nt
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.
- duplicates
-
JDK-4401598 win32 character encoding changed/broken in merlin-beta b46
-
- Resolved
-