-
Bug
-
Resolution: Fixed
-
P3
-
7
-
b62
-
generic
-
generic
In the transcript below, the first and third lines of output should be identical.
$ cat IBM949.java; jver 7 jr IBM949
public class IBM949 {
public static void main(String[] args) throws Throwable {
encode("IBM949", '\\');
encode("IBM949C", '\\');
encode("IBM949", '\\');
encode("IBM949C", '\\');
}
static void encode(String cs, char... chars) throws Throwable {
byte[] bytes = new String(chars).getBytes(cs);
for (int j = 0; j < bytes.length; j++) {
if (j > 0)
System.out.print(' ');
byte b = bytes[j];
System.out.printf("%02x", b & 0xff);
}
System.out.print("\n");
}
}
==> javac -Xlint:all IBM949.java
==> java -esa -ea IBM949
82
5c
5c
5c
$ cat IBM949.java; jver 7 jr IBM949
public class IBM949 {
public static void main(String[] args) throws Throwable {
encode("IBM949", '\\');
encode("IBM949C", '\\');
encode("IBM949", '\\');
encode("IBM949C", '\\');
}
static void encode(String cs, char... chars) throws Throwable {
byte[] bytes = new String(chars).getBytes(cs);
for (int j = 0; j < bytes.length; j++) {
if (j > 0)
System.out.print(' ');
byte b = bytes[j];
System.out.printf("%02x", b & 0xff);
}
System.out.print("\n");
}
}
==> javac -Xlint:all IBM949.java
==> java -esa -ea IBM949
82
5c
5c
5c