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

0xF9D6 --> 0xF9DC encoding for the locale zh_TW.BIG5 missing.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.4.0
    • core-libs



      Name: jl125535 Date: 11/13/2002


      FULL PRODUCT VERSION :
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

      FULL OPERATING SYSTEM VERSION :
      Microsoft Windows 2000 [Version 5.00.2195]
      Traditional Chinese version.

      A DESCRIPTION OF THE PROBLEM :
      The constructor

      String(byte[] bytes, int offset, int length, String
      charsetName)

      would not work correctly for "big5" charsetName for big5
      code 0xF9D6 to 0xF9DC. This 7 characters have widespread
      adopion within Taiwan.

      (Please see the attached testing code)
      The output of the testing code is all question mark(?)
      instead of the correct Chinese character. The other big5
      code works fine.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Open a dos command box (Make sure the code page is 950,
      tranditional Chinease big5).
      2. javac TryBig5.java
      3. java TryBig5
      4. See the outputs are all question mark (?) instend of the
      correct Chinese character.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      The correct Chinese character should appear beside the big5
      code, but the actual results is question mark(?)
      --------------------
      0xf9d6,?
      0xf9d7,?
      0xf9d8,?
      0xf9d9,?
      0xf9da,?
      0xf9db,?
      0xf9dc,?


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      //file: TryBig5.java

      public class TryBig5 {
      public static void main(String[] args) throws Exception {
           byte[] bytes = {(byte)0xf9,(byte)0xd6,(byte)0xf9,(byte)0xd7,(byte)0xf9,
      (byte)0xd8,(byte)0xf9,(byte)0xd9,(byte)0xf9,(byte)0xda,(byte)0xf9,(byte)0xdb,
      (byte)0xf9,(byte)0xdc};
           String value = new String(bytes, 0, bytes.length, "big5");
      for (int j=0;j < bytes.length; j+=2) {
      System.out.print("0x"+Integer.toHexString(bytes[j] & 0xff)
      +Integer.toHexString(bytes[j+1] & 0xff)+',');
      System.out.println(value.charAt(j/2));
      }
          }
      }

      ---------- END SOURCE ----------
      (Review ID: 153821)
      ======================================================================

            ilittlesunw Ian Little (Inactive)
            jleesunw Jon Lee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: