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

Korean characters do not display in TextArea with Monospaced font.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1.4, 1.1.6
    • core-libs
    • generic, x86
    • solaris_2.5.1, solaris_2.6



      Name: joT67522 Date: 11/20/97


      May be related to 4037637

      textArea.setFont(new Font("Monospaced",Font.PLAIN,12));

      The same Korean characters are displayed fine when
      the font is set to "SansSerif".

      Same problem on Solaris 2.5.1 and 2.6 X86 and
      Sparc.

      This problem has propogated since at least JDK
      1.1.2 if not 1.1.1.

      import java.awt.*;
      import java.text.*;
      import java.util.*;

      class KoreanTextAreaBugTest extends Frame
      {
          static DateFormat dateTimeFormat=fixDateFormatTimeZoneBug(DateFormat.getDate
      TimeInstance());
          static String timeString=dateTimeFormat.format(new Date());
          static String string="Actions: \uc791\uc5c5"; // Simultaneously display ISO
      8859-1 and KSC5601

          public KoreanTextAreaBugTest(String fontNm)
          {
              super(fontNm);
              Button button = new Button(string);
              TextArea textArea = new TextArea(3,20);
              textArea.setFont(new Font(fontNm,Font.PLAIN,12));

              setLayout(new BorderLayout());
              add("South",button);
              add("North",textArea);
              textArea.append(string);
              textArea.append("\n");
              textArea.append(timeString);
              pack();
          }

          static DateFormat fixDateFormatTimeZoneBug(DateFormat dateFormat)
          {
              dateFormat.setTimeZone(TimeZone.getDefault());
              return dateFormat;
          }

          public static void main(String[] args)
          {
              KoreanTextAreaBugTest koreanTextAreaBugTestMonospaced = new KoreanTextAr
      eaBugTest("Monospaced");
              koreanTextAreaBugTestMonospaced.show();
              KoreanTextAreaBugTest koreanTextAreaBugTestSansSerif = new KoreanTextAre
      aBugTest("SansSerif");
              koreanTextAreaBugTestSansSerif.show();
              KoreanTextAreaBugTest koreanTextAreaBugTestSerif = new KoreanTextAreaBug
      Test("Serif");
              koreanTextAreaBugTestSerif.show();
          }
      }

      (Review ID: 20468)
      ======================================================================

            sherman Xueming Shen
            johsunw Joon Oh (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: