Re: [wmii] WMII3 i18n

From: Anselm R. Garbe <garbeam_AT_wmii.de>
Date: Sun, 23 Apr 2006 23:20:24 +0200

On Sun, Apr 23, 2006 at 06:40:54PM +0200, Anselm R. Garbe wrote:
> > > here is twm realization of i18n, I think:
> > > Status
> > > I18N_FetchName(Display *dpy, Window w, char **winname)
> > > {
> > > int status;
> > > XTextProperty text_prop;
> > > char **list;
> > > int num;
> > >
> > > status = XGetWMName(dpy, w, &text_prop);
> > > if (!status || !text_prop.value || !text_prop.nitems) {
> > > *winname = NULL;
> > > return 0;
> > > }
> > > status = XmbTextPropertyToTextList(dpy, &text_prop, &list, &num);
> > > if (status < Success || !num || !*list) {
> > > *winname = NULL;
> > > return 0;
> > > }
> > > XFree(text_prop.value);
> > > *winname = (char *)strdup(*list);
> > > XFreeStringList(list);
> > > return 1;
> > > }
> > >
> > > Maybe it can help...
> > > Thank you in advance, Alexander Polakov
> >
> > Actually that won't help. I plan to use the Draw16 methods
> > instead of the plain Draw methods of Xlib, it is on TODO for
>
> Nah, to prevent confusion, Xutf8DrawString will be used, sorry.

Well, I investigated several hours of research and experimenting
into this issues now and I give up the hope, that it will work
until wmii-3. I looked at several window manager implementations
(including ion3, ahwm, sawfish, and fvwm), and all totally suck
in the way how they handle the i18n stuff.

There are at least three(!) ways for fetching the window title:
the old XA_WM_NAME text property (which always works), the
COMPOUND_TEXT atom property which originally has been invented
for locale support in Xlib (used with Xmb.* functions) and the
_NET_WM_NAME/UTF8_STRING stuff, which is intended to be used
with the Xutf8* stuff, added in XFree86 4.0.2+. But not all
clients support the COMPOUND_TEXT or _NET_WM_NAME/UTF8_STRING
propertues, thus one has to support all three ways and use the
XA_WM_NAME (current default) way as fallback.

I found several mails in various archives, claiming that Xutf8
is redundant and setting the locale to UTF8 within the code and
using Xmb.* stuff should work as well (seems like very ugly
hacks), oh dear...

You can imagine that this is pretty messy to be handled in a
clean way. The only half-decent way I can think of, is to
implement such kind of stuff in liblitz, but this will need
further investigation and much polishing until it might work
properly.

Thus, don't expect UTF8 support in wmii-3.

Regards,

-- 
 Anselm R. Garbe  ><><  www.ebrag.de  ><><  GPG key: 0D73F361
Received on Sun Apr 23 2006 - 23:20:25 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 16:03:23 UTC