Name: mc57594 Date: 03/06/97
String#getBytes("JIS") and OutputStreamWriter object created by
OutputStreamWriter w = new OutputStreamWriter(outputstream, "JIS");
encode strings incorrectly.
They always append shift-in sequence to encoded byte sequence, even if it is not necessary.
For example,
String s = new String("abc");
byte b[];
try {
b = s.getBytes("JIS");
..........
}
catch (Exception e) { ...... }
In this example, expected result is
b[] = { 'a', 'b', 'c' }
but result I gotten is
b[] = { 'a', 'b', 'c', '\x1b', '\x28', '\42' }
--------------------- shift-in
This is wrong clealy.
Is this bug ?
Thank you.
company - Kanazawa Research Institute , email - ###@###.###
======================================================================
- duplicates
-
JDK-4032402 CharToByteJIS *ALWAYS* adds ESC-(-B at the end of file
-
- Closed
-