UTF8 in window title on KDE - Xwindows

This is a discussion on UTF8 in window title on KDE - Xwindows ; Hello, I have a Motif application, which I have recently "upgraded" to use antialiased fonts (with XFT) and UTF-8 encoding, as OpenMotif 2.3 enables me to do this. Everything works fine, just the window and dialog titles are displayed incorrectly, ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: UTF8 in window title on KDE

  1. UTF8 in window title on KDE

    Hello,

    I have a Motif application, which I have recently "upgraded" to use
    antialiased fonts (with XFT) and UTF-8 encoding, as OpenMotif 2.3
    enables me to do this.
    Everything works fine, just the window and dialog titles are displayed
    incorrectly, they use iso8859-1 encoding. So it works OK for English,
    but not so well for other languages with characters >128.
    I am using KDE on SUSE 10.3

    To set the window title, I set the string with XmNdialogTitle resource.
    In the old days, there was no need to tell the encoding of the
    Widget's window title. So I guess Motif lacks a way to tell the
    character encoding for the title. Is there something I do not know about
    Motif, or is there a way to set window title from Xt or X?

    Other programs like Firefox have no problem displaying window
    title with various national characters.

    Thank you for your help,

    Dušan Peterc
    http://www.arahne.si

  2. Re: UTF8 in window title on KDE

    On 2008-05-21, arahne wrote:

    > I have a Motif application, which I have recently "upgraded"
    > to use antialiased fonts (with XFT) and UTF-8 encoding, as
    > OpenMotif 2.3 enables me to do this.
    > Everything works fine, just the window and dialog titles are
    > displayed incorrectly, they use iso8859-1 encoding.


    It's not too surprising that the window title would be subject
    to different rules as it's not purely internal to the toolkit.
    It's also used by the window manager, which might very well be a
    ten year old TWM.

    > is there a way to set window title from Xt or X?


    Xlib has XStoreName(). According to the man page, "if the string
    is not in the Host Portable Character Encoding, the result is
    implementation-dependent."

    > Other programs like Firefox have no problem displaying window
    > title with various national characters.


    Perhaps they set _NET_WM_NAME. It's a UTF-8 counterpart to
    ICCCM 2.0's WM_NAME and an X Desktop Group extension.

    http://standards.freedesktop.org/wm-...-spec-1.3.html

    --
    André Majorel
    "Cette supposition rappelle assez celle de ce prédicateur qui, en
    pleine chaire, faisait remarquer à ses fidèles la bonté de Dieu qui
    avait placé les rivières auprès des villes." -- Alexandre Dumas

  3. Re: UTF8 in window title on KDE

    Andre Majorel wrote:
    > Perhaps they set _NET_WM_NAME. It's a UTF-8 counterpart to
    > ICCCM 2.0's WM_NAME and an X Desktop Group extension.
    >
    > http://standards.freedesktop.org/wm-...-spec-1.3.html

    Thanks for the tip!
    After struggling a little with Atoms,
    I managed to set _NET_WM_NAME with XChangeProperty(),
    which takes the UTF-8 encoded string, and window manager
    then displays the window title correctly.

    Actually, Google code search for _NET_WM_NAME
    http://www.google.com/codesearch
    found the rest of the solution for me.

    Best regards,

    Dušan Peterc
    http://www.arahne.si



+ Reply to Thread