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?
It looks like besides the standard types
STRING,COMPOUND_STRINGandUTF8_STRING(the latter is an XFree86 extension), it is also acceptable to have any multibyte encoding.When passing
XTextStyletoXmbTextListToTextPropertywill simply take the current encoding from the current locale. In theen_US.UTF-8locale, that would beUTF-8. To get the standardized (by XFree86)UTF8_STRINGtype for the property, we need to passXUTF8StringStyletoXmbTextListToTextPropertyinstead ofXTextStyle