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

TextArea show (foreign) Unicode characters only if they are typed in

XMLWordPrintable

    • x86
    • windows_xp



      Name: jl125535 Date: 08/07/2002


      FULL PRODUCT VERSION :
      java version "1.4.1-rc"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-rc-b15)
      Java HotSpot(TM) Client VM (build 1.4.1-rc-b15, mixed mode)

      and

      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)


      FULL OPERATING SYSTEM VERSION :
      Microsoft Windows XP [Version 5.1.2600]
      Also occurs on Windows 2000 and Solaris 8.

      A DESCRIPTION OF THE PROBLEM :
      This bug is similar to 4102610, except that it occurs on Solaris as well.

      If I type in TextArea some cyrillic text, it shown
      properly, (same text inserted in JTextArea also shown ok)
      if I enter same text with append(String) or insert(String,
      int) then only question marks are shown.
      If I copy Cirillic text into TExtArea, it show also only
      question marks.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Start TextAreaTest
      2. You see at left side TextArea at right side JTextArea
      3. Text area show only qwestion marks instead of Cyrillic
      text; in JTextArea at right side you can see which text
      shold it be.
      4. If you have installed Cyrillic keyboard in your computer
      try to type some cyrillic text into TextArea. It shown
      properly.
      4a.Mark text you now typed, copy it and paste it into same
      TextArea. You see question marks.
      4b. Paste it to WordPad. WordPad show text properly. (It
      show us that copy FROM TextArea is OK).
      5. Copy some text from JTextArea to TextArea. TextArea
      show question marks instead of your text.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Expected:
      I expect that TextArea show properly foreign characters also after copy/paste
      and insert()/append().

      Actual:
      But only typed characters appear properly. Copied and programmatically
      inserted characters appear as question marks.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.*;
      import javax.swing.*;

      public class TextAreaTest {
      public static void main(String[] args) {
      Frame frame = new Frame();
      TextArea area = new TextArea();
      JTextArea area2 = new JTextArea();

      frame.setLayout(new GridLayout(1, 2));
      //String with some Unicode characters (Cyrillic)
      String s = "\u0428\u0412\u0415\u0420\u0422\u0426\u042E\u0418"
      + "\u041E\u041F\u0429\u042A";

      frame.add(area);
      frame.add(area2);

      area.append("TextArea:\n");
      area.append(s);
      area2.append("JTextArea:\n");
      area2.append(s);

      frame.pack();
      frame.setVisible(true);
      }
      }
      ---------- END SOURCE ----------
      (Review ID: 159581)
      ======================================================================

            yan Yuri Nesterenko
            jleesunw Jon Lee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: