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

Bidi Mirrored Characters (e.g., parenthesis) Display Reversed: Regression fm 1.3

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Duplicate
    • Affects Version/s: 1.4.2_13, 5.0u10
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      generic, sparc
    • OS:
      solaris_2.5.1, windows_2000

      Description

      In the upgrade from the 1.3.1.XX Java Plug-in (JPI) to 1.5.0_XX, our customer found that the Hebrew bidirectional (flipping) behavior of parenthesis, braces, brackets and other Unicode identified mirroring characters. That is, a string in Hebrew with 1.3.1.XX would have looked like (3)WERBEH and now looks like )3(WERBEH. To reproduce the problem:

      1) Set Control Panel | Regional and Language Options | Standards and Formats of the Regional Options tab to Hebrew.
      2) Run the following applet with JPI 1.5.0_09:

      import java.awt.ComponentOrientation;

      import javax.swing.JApplet;
      import javax.swing.JLabel;
      import javax.swing.JPanel;
      import javax.swing.JTextField;

      import java.awt.BorderLayout;
      import java.awt.GridLayout;

      public class RTLSun extends JApplet
      {
        public void init()
        {
          JLabel jl1 = new JLabel("RTL JLabel with BDO");
          jl1.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
          JLabel jl1w = new JLabel("\u202d\u05e2\u05d1\u05e8\u05d9\u05ea(5)");
          jl1w.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
          JLabel jl2 = new JLabel("RTL JLabel without BDO");
          jl2.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
          JLabel jl2wo = new JLabel("\u05e2\u05d1\u05e8\u05d9\u05ea(5)");
          jl2wo.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
          JPanel jp1 = new JPanel(new GridLayout(4,1));
          jp1.add(jl1);
          jp1.add(jl1w);
          jp1.add(jl2);
          jp1.add(jl2wo);

          JLabel jl3 = new JLabel("RTL JTextField with BDO");
          jl3.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
          JTextField jtfw = new JTextField("\u202d\u05e2\u05d1\u05e8\u05d9\u05ea(5)");
          jtfw.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
          JLabel jl4 = new JLabel("RTL JTextField without BDO");
          jl4.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
          JTextField jtfwo = new JTextField("\u05e2\u05d1\u05e8\u05d9\u05ea(5)");
          jtfwo.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
          JPanel jp2 = new JPanel(new GridLayout(4,1));
          jp2.add(jl3);
          jp2.add(jtfw);
          jp2.add(jl4);
          jp2.add(jtfwo);


          getContentPane().add(jp1, BorderLayout.NORTH);
          getContentPane().add(jp2, BorderLayout.SOUTH);

          setVisible(true);
        }
      }

      Note that the behavior regresses only with the inclusion of the Left-to_right Override (BDO) Unicode Character (U+202D). Note also that the problem does not reproduce with Arabic instead of Hebrew. Lastly, note that this bug no longer reproduces with Java SE 6 RC, though it consistently reproduces with 1.4.2_12 and 1.5.0_10.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              srl Steven Loomis
              Reporter:
              mmma Marvin Ma (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: