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

multi-byte chars ("(B") sent to title bar of windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.2
    • 1.1.7, 1.3.1
    • client-libs
    • mantis
    • sparc
    • solaris_2.5.1, solaris_8



      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)
      ======================================================================

            uwesunw Uwe Uwe (Inactive)
            yyoungsunw Yung-ching Young (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: