Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6616

[classlib][nio_char] Incompatible charsets of Charset.availableCharsets() between RI6 and Harmony6

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.0M14
    • 5.0M16
    • Classlib
    • None
    • Patch Available

    Description

      I have run a test to print all available charsets returned by Charset.availableCharsets() both on RI6 and Harmony6, and find RI and harmony return different names for some charsets, below is the summary:
      RI6 names Harmony6 names
      IBM00858 cp858
      IBM850 cp850
      IBM857 cp857
      IBM860 cp860
      IBM861 cp861
      IBM862 cp862
      IBM863 cp863
      IBM864 cp864
      IBM865 cp865
      IBM866 cp866
      IBM868 cp868
      IBM869 cp869
      x-IBM737 x-ibm-737_P100-1997
      x-IBM856 cp856
      x-IBM875 x-ibm-875_P100-1995
      x-IBM922 cp922
      x-IBM1006 x-ibm-1006_P100-1995
      x-IBM1025 x-ibm-1025_P100-1995
      x-IBM1112 x-ibm-1112_P100-1995
      x-IBM1122 x-ibm-1122_P100-1999
      x-IBM1123 x-ibm-1123_P100-1995
      x-IBM1124 x-ibm-1124_P100-1996
      x-IBM1097 x-ibm-1097_P100-1995
      x-IBM1098 x-ibm-1098_P100-1995
      x-MacCyrillic x-mac-cyrillic
      x-MacGreek x-mac-greek
      x-MacTurkish x-mac-turkish

      Java spec for Charset.availableCharsets() says: Constructs a sorted map from canonical charset names to charset objects. So the difference is due to RI and Harmony6 use different charset names as the canonical names.

      For example the pair of IBM00858 and cp858 belongs to the same charset, RI uses IBM00858 as the canonical name but Harmony uses cp858, thus they return different charset names for the availableCharsets(). Above charsets are provided by harmony built-in charsets. I suppose RI's behavior should be the right one which implies RI uses the correct canonical charset names so I have changed this built-in charsets to comply with RI.

      Attachments

        1. HARMONY-6616.diff
          11 kB
          deven you

        Activity

          People

            Unassigned Unassigned
            deven deven you
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 168h
                168h
                Remaining:
                Remaining Estimate - 168h
                168h
                Logged:
                Time Spent - Not Specified
                Not Specified