[Xcb] [PATCH:xwininfo 0/2] Handle UTF8 window names & EMWH hints

James Cloos cloos at jhcloos.com
Thu Jul 1 11:29:06 PDT 2010


After testing the latest change, the name still fails with xterm and a
title which has a character which, in utf8, has an octet > 0x7F and < 0xA0.
When any octet in the STRING is in [0x80,0x9F] (aka in C1) it gets replaced
with '?' at some point, thus invalidating the utf8.

In the code which prints WM_NAME(STRING):

            if (wm_name_encoding == XCB_ATOM_STRING) {
                printf (" \"%.*s\"", wm_name_len, wm_name);

the printf(3) fails to output the %s at all because of that.

I don't think this is enough of a bug to prevent pushing the code.
Since ICCCM says STRING is latin1, apps really shouldn't claim non-
latin1 text is a STRING when setting the prop, but rather should
use COMPOUND_TEXT.  And they should also upgrade to the _NET props.

The string which xwininfo gets will be valid latin1 by the time it sees
it.  (gdb tells me the octet in question is 63 '?', the replacement
definately occurred before xwininfo called xcb_get_property_value().)

And splitting that printf() to separately print the closing '"' seems ugly.

So, as of commit 2027cacfaa6947145bb81e2e79d08d2484c428b4,

Reviewed-by: James Cloos <cloos at jhcloos.com>

-JimC
-- 
James Cloos <cloos at jhcloos.com>         OpenPGP: 1024D/ED7DAEA6


More information about the Xcb mailing list