Harmony
  1. Harmony
  2. HARMONY-139

[classlib][ICU] characters 0x0384 and 0xB7 are unmapped in ICU implementation of ISO8859-7

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Classlib
    • Labels:
      None

      Description

      Looks like characters 0x0384 and 0xB7 are unmapped in ICU implementation. Mapping table could be found here: http://www.unicode.org/Public/MAPPINGS/ISO8859/8859-7.TXT
      Please use test below for reproducing:

      import java.nio.*;
      import java.nio.charset.*;
      import com.ibm.icu4jni.charset.CharsetProviderICU;

      import junit.framework.TestCase;

      public class Harmony139 extends TestCase{

      public static void main(String args[])

      { junit.textui.TestRunner.run(Harmony139.class); }

      public void testEncode_JIRA139_1() throws Exception {
      CharsetProviderICU provider = new CharsetProviderICU();
      Charset iso8859_7 = provider.charsetForName("ISO-8859-7");
      // Uncomment code below to use RI charset
      //Charset iso8859_7 = Charset.forName("ISO-8859-7");
      CharBuffer cb = CharBuffer.allocate(1);
      cb.put((char)0x0384); cb.flip();
      ByteBuffer bb = iso8859_7.newEncoder().replaceWith(new byte[]

      {0x3F}).onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE).encode(cb);
      assertEquals((byte)0xB4, bb.get(0));
      }

      public void testEncode_JIRA139_2() throws Exception {
      CharsetProviderICU provider = new CharsetProviderICU();
      Charset iso8859_7 = provider.charsetForName("ISO-8859-7");
      // Uncomment code below to use RI charset
      //Charset iso8859_7 = Charset.forName("ISO-8859-7");
      CharBuffer cb = CharBuffer.allocate(1);
      cb.put((char)0xB7); cb.flip();
      ByteBuffer bb = iso8859_7.newEncoder().replaceWith(new byte[] {0x3F}

      ).onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE).encode(cb);
      assertEquals((byte)0xB7, bb.get(0));
      }
      }

      Both tests passed with RI, and failed with Harmony.

        Activity

        Vladimir Strigun created issue -
        Show
        Tim Ellison added a comment - Reported as http://dev.icu-project.org/cgi-bin/icu-bugs/incoming?findid=5087
        Hide
        Nathan Beyer added a comment -

        Is this still a valid issue? A comment on the ICU bug suggests that we may have an invalid version.

        Vladimir, Can you please test this again using the latest revision? Thanks.

        Show
        Nathan Beyer added a comment - Is this still a valid issue? A comment on the ICU bug suggests that we may have an invalid version. Vladimir, Can you please test this again using the latest revision? Thanks.
        Hide
        Vladimir Strigun added a comment -

        Nathan, thank you for the reminder.
        I still can reproduce this bug with ICU 3.4 but I think the bug is not very important. We can mark it as non-bug difference from RI and close it.

        Show
        Vladimir Strigun added a comment - Nathan, thank you for the reminder. I still can reproduce this bug with ICU 3.4 but I think the bug is not very important. We can mark it as non-bug difference from RI and close it.
        Hide
        Nathan Beyer added a comment -

        Vladimir, Can you take a look at the bug logged at the ICU site and possibly comment on it there? They seem to think it works fine.

        Show
        Nathan Beyer added a comment - Vladimir, Can you take a look at the bug logged at the ICU site and possibly comment on it there? They seem to think it works fine.
        Hide
        Paulex Yang added a comment -

        I had same issue recently, the problem is still reproducible on the ICU4JNI/ICU4C version Harmony current uses(3.4), and I checked the mapping table of latest version(3.6), seems nothing changed here.

        Show
        Paulex Yang added a comment - I had same issue recently, the problem is still reproducible on the ICU4JNI/ICU4C version Harmony current uses(3.4), and I checked the mapping table of latest version(3.6), seems nothing changed here.
        Alexey Petrenko made changes -
        Field Original Value New Value
        Summary ICU - characters 0x0384 and 0xB7 are unmapped in ICU implementation of ISO8859-7 [classlib][ICU] characters 0x0384 and 0xB7 are unmapped in ICU implementation of ISO8859-7
        Hide
        Tim Ellison added a comment -

        The test shown in original description now passes on the latest Harmony code (r696647) - thanks to the new version of ICU.

        Show
        Tim Ellison added a comment - The test shown in original description now passes on the latest Harmony code (r696647) - thanks to the new version of ICU.
        Tim Ellison made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Tim Ellison [ tellison ]
        Tim Ellison made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Tim Ellison
            Reporter:
            Vladimir Strigun
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development