JDK-6515107 : AWT application does not show Unicode character \u0159, but Swing does
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.2_13,6u2
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic,windows_vista
  • CPU: generic,x86
  • Submitted: 2007-01-19
  • Updated: 2011-07-19
Related Reports
Duplicate :  
Relates :  
Description
An AWT application does not show the Unicode character \u0159, but the Swing application does. 

Attachments of this report:
testcases.zip - testcases for both AWT and Swing (both sourcecode and bytecode)
screenshots.zip - screenshots of the tests under Windows XP SP 2
Czech.png - screenshot of the customer's real live application

Run the testcase by entering
java -cp . CzechFrame
respectively
java -cp . CzechJFrame

These are the results

AWT (CzechFrame)
----------------
                   JDK 1.6   JDK 1.5.0_10   JDK 1.4.2_13
Solaris 9          OK        FAILED         FAILED
Windows XP SP 2    FAILED    FAILED         FAILED


Swing (CzechJFrame)
-------------------
                   JDK 1.6   JDK 1.5.0_10   JDK 1.4.2_13
Solaris 9          OK        OK             OK
Windows XP SP 2    OK        OK             OK


FAILED means that a rectangle is shown rather than the expected character.
I've just found one more regularity:

Running Java Application from Intellij IDEA (I used 10.0.3 Community Edition) resolves this issue (in both Run & Debug modes).
Running the same application other ways (including Debug under MS Visual C++ 2010 Express) shows squares.
Tested on Windows 7.

PS: WIN32 API function 'CreateFont' is called with fdwCharSet=DEFAULT_CHARSET in all cases. Seems like this value is not stable in its result.

Comments
EVALUATION We hope to fix this in jdk7 using newer native Unicode support not available in Win98.
26-07-2007

EVALUATION Not reproducible with the native test, on WinXP. I think the problem is that Java doesn't use native Unicode support implemented in Win2K and later Windows.
23-01-2007

WORK AROUND Workaround for JRE 1.4.2, 5.0 and 6 on Windows: Select Control Panel -> Regional Options -> Standard and formats -> Czech.
23-01-2007

WORK AROUND Workaround for both JRE 1.4 and JRE 5 on Solaris: $ setenv LC_ALL cs_CZ.ISO8859-2 (for csh) (make sure that no error returns) Workaround for JRE 5 on Solaris: $ setenv AWT_TOOLKIT XToolkit (for csh) See also http://java.sun.com/j2se/1.5.0/docs/guide/awt/1.5/xawt.html
23-01-2007