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

Korean characters are not rendered correctly in Arial font, in Korea locale

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3 P3
    • None
    • 7u25
    • client-libs
    • 2d
    • windows_7

      FULL PRODUCT VERSION :
      Java 1.7.0_25-b17

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows 7 Version 6.1 (Build 7601: Service Pack 1)

      A DESCRIPTION OF THE PROBLEM :
      In a Korea locale, Korean characters are displayed as empty boxes with Arial font.




      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Compile and run the attached code

      There will be two labels showing the same string of example Korean characters.

      One in monospaced font, the other in Arial. Note that the JLabel with Arial font is not rendered.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The characters should be rendered in a readable fashion.
      ACTUAL -
      The characters appear as boxes.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.BorderFactory;
      import javax.swing.JFrame;
      import javax.swing.JLabel;
      import java.awt.Color;
      import java.awt.FlowLayout;
      import java.awt.Font;

      public class ScratchUnicodeCharacters {
          public static void main(String[] args) {
              int num = Integer.parseInt( " 20E3 " , 16);

              // Below string should have Korean characters
              String string = " ?? ? ??? ? ?? ? 1234567890 " ;

              JFrame frame= new JFrame();
              frame.setLayout(new FlowLayout());

              JLabel label = new JLabel( " Arial " + string);
              label.setBorder(BorderFactory.createLineBorder(Color.black));
              label.setFont(new Font( " Arial " , Font.PLAIN, 12));

              JLabel label2 = new JLabel( " Monospaced " + string);
              label2.setBorder(BorderFactory.createLineBorder(Color.black));
              label2.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));

              frame.add(label);
              frame.add(label2);

              frame.setVisible(true);
              frame.pack();
          }
      }

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

      CUSTOMER SUBMITTED WORKAROUND :
      Using a Monospaced font works.

            prr Philip Race
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: