Question

I'm looking at some X11 code that uses XmbTextListToTextProperty to set the WM_NAME property, with encoding style XTextStyle.

http://tronche.com/gui/x/xlib/ICC/client-to-window-manager/XmbTextListToTextProperty.html suggests XTextStyle means the type/encoding of the property will depend on the current locale.

I'm not sure how to interpret http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.2.1 , it seems it allows the type of WM_NAME to be dependent of the current locale.

My current locale is 'en_US.UTF-8'. Everything I've seen so far suggests that the type of WM_NAME should be of type STRING, COMPOUND_STRING or UTF8_STRING.

However, xprop reports UTF-8, and xwininfo reports 'name in unsupported encoding UTF-8'. Checking the code, indeed it has support for UTF8_STRING but not UTF-8.

I'm at a loss as to where this UTF-8 comes from. Any ideas?

Was it helpful?

Solution

It looks like besides the standard types STRING, COMPOUND_STRING and UTF8_STRING (the latter is an XFree86 extension), it is also acceptable to have any multibyte encoding.

When passing XTextStyle to XmbTextListToTextProperty will simply take the current encoding from the current locale. In the en_US.UTF-8 locale, that would be UTF-8. To get the standardized (by XFree86) UTF8_STRING type for the property, we need to pass XUTF8StringStyle to XmbTextListToTextProperty instead of XTextStyle

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top