JDK-6543928 : java.awt.choice is not able to display unicode charecters like \u2019
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2007-04-09
  • Updated: 2011-04-29
Related Reports
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.4.2_11"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_11-b06)
Java HotSpot(TM) Client VM (build 1.4.2_11-b06, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
windows 2000

A DESCRIPTION OF THE PROBLEM :
java.awt.Choice ,  java.awt.List , java.awt.Button  not able to display unicode charecters like \u2018, \u2019 .

NOTE: java.awt.TextField can display those charecters.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Please run the Sample Program.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
choice , List , Button should not show Garbage(square).
It has to show corresponding unicode charecter.
please see the TextField for actual output
ACTUAL -
Garbage charecters are displayed instead of actual charecters.

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
import java.awt.*;
import java.applet.*;


public class TestUnicode {

  public static void main(String[] args) {

		Frame f = new Frame();
		Button b = new Button( "\u2019 = \\u2019 \u2018 = \\u2018");
		List l = new List();
		Choice ch = new Choice();
		f.setLayout(new FlowLayout());
		ch.addItem("\u2019 = \\u2019");
		ch.addItem("\u2018 = \\u2018");
		l.addItem("\u2019 = \\u2019");
		l.addItem("\u2018 = \\u2018");
		TextField e = new TextField("\u2019 = \\u2019 \u2018 = \\u2018");
		f.add(e);
		f.add(ch);
		f.add(b);
		f.add(l);
		f.pack();
		f.show();
  }
}

Comments
WORK AROUND The workaround suggested by the customer for this issue is just by passing the locale as VM parameter. java -Duser.language=th -Duser.country=TH TestUnicode
17-04-2007

EVALUATION Looks like the source of the problem is right the same as for 6515107: AWT should use Win2K/XP/Vista unicode support.
13-04-2007