Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

UTF8 in window title on KDE

73 views
Skip to first unread message

arahne

unread,
May 21, 2008, 2:06:31 PM5/21/08
to
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

Andre Majorel

unread,
May 23, 2008, 2:46:14 PM5/23/08
to
On 2008-05-21, arahne <ara...@arahne.si> 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/wm-spec-1.3.html

--
André Majorel <URL:http://www.teaser.fr/~amajorel/>
"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

arahne

unread,
May 24, 2008, 6:06:46 PM5/24/08
to
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/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


0 new messages