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

(cs) Extended charsets not always loaded

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.4.1
    • Fix Version/s: None
    • Component/s: core-libs
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      The old code converters are invoked with the following test program even
      there are NIO code converters (as extended charsets) are available.

      public class JConv {
          public static void main(String[] a) {
      String msg = "\u3053\u3093\u306b\u3061\u306f\u4e16\u754c";
      byte[] b = msg.getBytes();
      String s = new String(b);
      System.out.println(s);
          }
      }

      Its output on Solaris is:

      % setenv LANG ja
      % java -version
      java version "1.4.2-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b02)
      Java HotSpot(TM) Client VM (build 1.4.2-beta-b02, mixed mode)
      % java -verbose JConv | grep EUC
      [Loaded sun.io.ByteToCharEUC_JP from .../jre/lib/charsets.jar]
      [Loaded sun.io.CharToByteEUC_JP from .../jre/lib/charsets.jar]
      % setenv LANG zh
      % java -verbose JConv | grep EUC
      [Loaded sun.io.ByteToCharEUC_CN from .../jre/lib/charsets.jar]
      [Loaded sun.io.CharToByteEUC_CN from .../jre/lib/charsets.jar]

      However, both the old and NIO code converters are used in javac.

      % javac -J-verbose JConv.java | grep EUC
      [Loaded sun.io.ByteToCharEUC_JP from .../jre/lib/charsets.jar]
      [Loaded sun.io.CharToByteEUC_JP from .../jre/lib/charsets.jar]
      [Loaded sun.nio.cs.ext.EUC_JP from .../jre/lib/charsets.jar]
      [Loaded sun.nio.cs.ext.EUC_JP$Encoder from .../jre/lib/charsets.jar]
      [Loaded sun.nio.cs.ext.EUC_JP$Decoder from .../jre/lib/charsets.jar]

      ###@###.### 2002-10-10

        Attachments

          Activity

            People

            Assignee:
            sherman Xueming Shen
            Reporter:
            okutsu Masayoshi Okutsu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: