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

-Dfile.encoding option doesn't affect default ByteToChar converter

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic, x86, sparc
    • OS:
      generic, linux, solaris_2.6, solaris_9, windows_nt, windows_2000

      Description

      In JDK1.2fcs, even if you set -Dfile.encoding option,
      it doesn't affect ByteToChar converter.
      In case of JDK1.2beta4, -Dfile.encoding option affects
      both ByteToChar converter and CharToByte converter.

      Run the following program.

      --- program ---
      import sun.io.CharToByteConverter;
      import sun.io.ByteToCharConverter;

      public class DefaultEncoding {
          public static void main (String args[]) {
              System.out.println(ByteToCharConverter.getDefault().toString());
              System.out.println(CharToByteConverter.getDefault().toString());
          }
      }

      --- result ---
      Win32, JDK1.2fcs_D:
      C:\>java DefaultEncoding
      ByteToCharConverter: SJIS
      CharToByteConverter: SJIS

      C:\>java -Dfile.encoding=EUC_JP DefaultEncoding
      ByteToCharConverter: SJIS
      CharToByteConverter: EUC_JP

      Win32, JDK1.2beta4_K:
      C:\>java DefaultEncoding
      ByteToCharConverter: SJIS
      CharToByteConverter: SJIS

      C:\>java -Dfile.encoding=EUC_JP DefaultEncoding
      ByteToCharConverter: EUC_JP
      CharToByteConverter: EUC_JP

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mr Mark Reinhold
              Reporter:
              eishidasunw Etsuko Ishida (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: