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

Font-Renderer should ignore invisible characters \u2062 and \u2063

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 6
    • client-libs
    • 2d
    • b10
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      java version "1.6.0_01"
      Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
      Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Windows

      A DESCRIPTION OF THE PROBLEM :
      The font renderer in Java should ignore the three invisible characters (http://unicode.org/charts/PDF/U2000.pdf):

      U+2061 FUNCTION APPLICATION
      U+2062 INVISIBLE TIMES
      U+2063 INVISIBLE SEPARATOR

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      javax.swing.JOptionPane.showMessageDialog( null, "a\u2063+\u2063a\u2063=\u20632\u2062a" );

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The chars \u2062 and \u2063 should give no visible glyph or a small space.
      ACTUAL -
      The ui shows boxes for an unknown character.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package com.tutego.bug.sun;

      public class U2062a
      {
        public static void main( String[] args )
        {
          String string = "a\u2063+\u2063a\u2063=\u20632\u2062a";
          
          javax.swing.JOptionPane.showMessageDialog( null, string );
        }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Replace all INVISIBLE chars.

      string = string.replaceAll( "\u2061|\u2062|\u2063", "" );

            dgredler Daniel Gredler
            ryeung Roger Yeung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: