Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4727926
Votes 0
Synopsis TextArea show (foreign) Unicode characters only if they are typed in
Category java:classes_awt
Reported Against hopper-beta
Release Fixed
State 11-Closed, Not Reproducible, bug
Priority: 4-Low
Related Bugs 4102610
Submit Date 07-AUG-2002
Description




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 :
 customer  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) 
======================================================================
Work Around
N/A
Evaluation





The bug is reproducible on Windows 2000 with JDK1.4.2b01.
It looks like TextArea (as against JTextArea) can not paste text
from the clipboard with the CF_UNICODETEXT format.
  xxxxx@xxxxx   2002-08-21

======================================================================
We need to check if this issue is gone away after the fix for 4102610.
Posted Date : 2007-04-20 09:03:36.0

Not reproducible any more even in 6u10.
Posted Date : 2008-07-23 10:08:03.0
Comments
  
  Include a link with my name & email   

Submitted On 18-JUN-2007
This issue isn't fully fixed. When Chinese characters are programmatically appended, they are not displayed correctly. When typed into the TextAreas, they are displayed correctly. The code I used to test is as follows:

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();
		
		Font font = new Font("SimSun", Font.PLAIN, 13);
		area.setFont(font);
		area2.setFont(font);

		frame.setLayout(new GridLayout(1, 2));
		String s = "一人大";

		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);
	}
}



PLEASE NOTE: JDK6 is formerly known as Project Mustang