#106575 Window and icon title in Window Maker -- broken internationalisation

Package:
wmaker
Source:
wmaker
Description:
NeXTSTEP-like window manager for X
Submitter:
Juliusz Chroboczek
Date:
2005-07-18 03:52:40 UTC
Severity:
normal
#106575#5
Date:
2001-07-25 18:24:02 UTC
From:
To:
Hello,

Let me congratulate you on the fast resolution of the previous issue.
The corrected version hasn't hit my mirror yet, so I cannot check it.

Here's another upstream bug; I'd be grateful if you could forward it.
In file misc.c, functions wFetchName and wGetIconName, there is some
convoluted code to filter property types.  This code is incorrect on
two counts:

1. There is no need to special case XA_STRING, which is defined by the
ICCCM to contain ISO 8859-1 text, not locale-dependent text as the
code erroneously assumes.  An XA_STRING property will be correctly
converted by the TextPropertyToTextList utility function.

2. There is no need to check the property type in client code in the
first place.  The Xlib utility functions will do the checking for you,
and reliably return an error result if they cannot perform the
conversion.  This way, if Xlib gets extended to new property types
(current versions also handle XA_UTF8_STRING), the client will
transparently benefit of the new functionality.

In addition, I do not agree with the fallback code (the wstrdup
fallback case).  If the property conversion failed, the window or icon
title is probably garbage.  The correct approach would be to declare
the window to be unnamed (return False).

An example of the correct code is in twm, as included in XFree86 4.1.0
and later (previous versions had the same bug as Window Maker,
introduced by the very person who probably introduced this bug in
Window Maker).  Please see

http://cvsweb.xfree86.org/cvsweb/xc/programs/twm/util.c?rev=1.8&content-type=text/x-cvsweb-markup

and search for the functions I18N_FetchName and I18N_GetIconName.

Regards,

                                        Juliusz