United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4481877 multi-byte chars ("(B") sent to title bar of windows
JDK-4481877 : multi-byte chars ("(B") sent to title bar of windows

Details
Type:
Bug
Submit Date:
2001-07-19
Status:
Resolved
Updated Date:
2002-09-06
Project Name:
JDK
Resolved Date:
2002-09-06
Component:
client-libs
OS:
solaris_8,solaris_2.5.1
Sub-Component:
java.awt
CPU:
sparc
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.1.7,1.3.1
Fixed Versions:
1.4.2 (mantis)

Related Reports
Duplicate:

Sub Tasks

Description

Name: yyT116575			Date: 07/19/2001


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


Create a simple java program that displays a window (code to follow).  The
window title begins with 'Esc'(B then the title string.  This can be seen
most easily on the FVWM window manager compiled without multi-byte support.

If $LANG and $LC_CTYPE are set to en_US.ISO8859-1 or just about any other
language, then multi-byte chars are sent to the title bar of a window.


I used "xprop" to look at the property WM_NAME which is where the title
comes from.

Without LANG set, Java sets WM_NAME like this:
WM_NAME(COMPOUND_TEXT) = 0x54, 0x68, 0x69, 0x73, ...

With LANG set, Java sets WM_NAME like this:
WM_NAME(COMPOUND_TEXT) = 0x1b, 0x28, 0x42, 0x54, ...

The 0x54 is the first character of the windows title, an uppercase T.

So with LANG set, the characters "0x1b, 0x28, 0x42," ("Esc ( B") are
added to the window title.

If Fvwm is compiled with multibyte support, that string is passed thru
XmbTextPropertyToTextList() which removes the "Esc ( B" prefix.

I think this should be persued with Sun.  So far I see 2 issues:

I don't see why fvwm should need to  support Multibyte characters when
the language is explicitly set to en_US, or fr_CA, neither of these
languages are multibyte.

I don't think it's correct for Java to be setting the text property to
COMPOUND_TEXT when LANG isn't set.  Normally the property on a title
would be STRING.

Here is the code to reproduce:
import javax.swing.*;

public class WindowTest {
  static void main (String[] args) {
    JFrame win = new JFrame ("This is the window Title");
    //win.setTitle ("Window Title 2");
    win.getContentPane().add (new JLabel ("Test the JWindow"));
    win.setSize (200, 200);
    win.pack();
    win.show ();
  }
}

Here is a url to image of the window created:

http://www.employees.org/~keiths/WindowTest.gif

I am running on Solaris 8 with FVWM 2.4.0.  I've tested this in both 1.3.1 and
Java 1.4-beta.
(Review ID: 128437) 
======================================================================

                                    

Comments
EVALUATION

I don't believe fvwm is officially supported.
richard.ray@eng 2001-07-19 

There may be some relevant text about APIs for manipulating 
COMPOUND_TEXT in 4480365.  
###@###.### 2001-09-12
                                     
2001-07-19
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
mantis

FIXED IN:
mantis

INTEGRATED IN:
mantis


                                     
2004-06-14



Hardware and Software, Engineered to Work Together