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

NLS: NON-LATIN1 TEXT DOES NOT DISPLAY IN AWT TEXTFIELD

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • None
    • 1.1.6
    • client-libs



      Name: diC59631 Date: 07/16/98


      This is from Oracle, a Java licensee.
      The Oracle bug number is 675734.
          
      This bug did occur with 1.1.6. Please consider this a regression problem,
      and examine it ASAP.

      To reproduce this problem the following code should be compiled with javac and
      run with appletviewer.
      import java.applet.Applet;
      import java.awt.*;
      import java.util.Locale;
      import java.lang.System;
      public class tf extends Applet
      {
        TextField tf1, tf2, tf3;
        Label l1, l2;
        public void init() {
          Locale myLocale = Locale.getDefault();
          tf1 = new TextField("Hello");
          tf2 = new TextField(myLocale.getDisplayLanguage());
          tf3 = new TextField("\u65e5\u672c");
          l1 = new Label(myLocale.getDisplayLanguage());
          l2 = new Label("\u65e5\u672c");
          GridBagLayout gridBag = new GridBagLayout();
          setLayout(gridBag);
          GridBagConstraints c = new GridBagConstraints();
          c.gridwidth = GridBagConstraints.REMAINDER;
          c.fill = GridBagConstraints.HORIZONTAL;
          gridBag.setConstraints(tf1, c);
          add(tf1);
          gridBag.setConstraints(tf2, c);
          add(tf2);
          gridBag.setConstraints(tf3, c);
          add(tf3);
          gridBag.setConstraints(l1, c);
          add(l1);
          gridBag.setConstraints(l2, c);
          add(l2);
          validate();
        }
      }
      This program calls getDisplayLanguage in a TextField as well as trying to
      display some CJK Unicode characters in a TextField. This fails for the
      following Windows NT4 Regional Setting/Languages:
      Arabic, Czech, Greek, Japanese, Korean, Romanian, Russian, Slovak, Slovenian,
      Turkish, Simplified Chinese, Traditional Chinese, Hebrew, and Thai. It is also
      believed to affect Hungarian and Polish though this sample program doesn't show
      that well. Note that this probably affects a much larger set of languages.
      Also, this problem also appears in JDK1.1.4FCS.
      This program includes a display of the same getDisplayLanguage and CJK
      characters in Label components instead of TextField components. The Label
      components display without problem. It is not clear how many AWT components
      are affected by this bug, but another sample program has shown this bug in List
      componenets.
      It should also be noted that within an English OS this problem affects all the
      languages listed above. In any localized OS, the languages affects will be
      other than the local language and any Latin1 language. For example, testing
      in the Japanese environment shows correct display of Japanese and Latin1
      characters, but all non-Japanese, non-Latin1 languages fail.
      (Review ID: 34828)
      ======================================================================

            sherman Xueming Shen
            dindrigo Daniel Indrigo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: