JDK-4139280 : Incorrect Java converters for Gaiji characters(IBM, NEC, NEC IBM characters set)
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 1.1.6
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1998-05-17
  • Updated: 1998-07-29
  • Resolved: 1998-07-29
Related Reports
Duplicate :  
Description

Name: tb29552			Date: 05/17/98


This bug has been submitted before as 4075413,
but this bug is in the "Closed, not a bug" state
for some reason or the other.

The round trip for this characters:
 - Read file with these characters using Java converter
    ("SJIS" as implicit character decoding string)

 - Write to the file using Java converter ("SJIS" as implicit 
     character decoding string)

gives completely different result.

I'm using InputStreamReader, OutputStreamWriter for this purpose.
The example of simplest test:

try {
    InputStream  in = new FileInputStream ("inputfile.txt");
    OutputStream ou = new FileOutputStream("outputfile.txt");

    Reader r = new BufferedReader(new InputStreamReader(in,"SJIS"));
    Writer w = new BufferedWriter(new OutputStreamWriter(ou,"SJIS"));

    char[]buffer = new char[4096];
    int len;
    while ((len=r.read(buffer)) != -1)
       w.write(buffer,0,len);
    r.close();
    w.flush();
    w.close();

  }
  catch(Exception e) {
  }

The using only OutputStreamWriter gives incorrect result also.

The same situation when I try to use these classes with default
encoding string, i.e. using the following constructor
InputStreamReader(inputStream in).

The result of  System.getProperty("file.encoding") equals
"SJIS" on my Windows NT machine.
(Review ID: 29957)
======================================================================

Comments
EVALUATION Currently, the SJIS converts don't support Gaiji. masayoshi.okutsu@Eng 1998-07-29
29-07-1998