X11 XM_NAME 类型为“UTF-8”;而不是 STRING_UTF8
我正在查看一些使用 XmbTextListToTextProperty
来设置 WM_NAME
属性的 X11 代码,编码样式为 XTextStyle
。
http://tronche.com/gui/x /xlib/ICC/client-to-window-manager/XmbTextListToTextProperty.html 建议 XTextStyle
表示属性的类型/编码将取决于当前区域设置。
我不知道如何解释 http://tronche .com/gui/x/icccm/sec-4.html#s-4.1.2.1 ,似乎它允许 WM_NAME
的类型依赖于当前区域设置。
我当前的区域设置是“en_US.UTF-8”。到目前为止我所看到的一切都表明 WM_NAME
的类型应该是 STRING
、COMPOUND_STRING
或 UTF8_STRING
类型。
但是,xprop
报告 UTF-8
,而 xwininfo
报告“名称采用不支持的编码 UTF-8”。检查代码,确实支持 UTF8_STRING
,但不支持 UTF-8
。
我不知道这个 UTF-8
来自哪里。有什么想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来除了标准类型
STRING
、COMPOUND_STRING
和UTF8_STRING
(后者是 XFree86 扩展)之外,任何多字节也是可以接受的编码。将
XTextStyle
传递给XmbTextListToTextProperty
时,只会从当前区域设置获取当前编码。在en_US.UTF-8
语言环境中,这将是UTF-8
。要获得属性的标准化(通过 XFree86)UTF8_STRING
类型,我们需要将XUTF8StringStyle
传递给XmbTextListToTextProperty
而不是XTextStyle
It looks like besides the standard types
STRING
,COMPOUND_STRING
andUTF8_STRING
(the latter is an XFree86 extension), it is also acceptable to have any multibyte encoding.When passing
XTextStyle
toXmbTextListToTextProperty
will simply take the current encoding from the current locale. In theen_US.UTF-8
locale, that would beUTF-8
. To get the standardized (by XFree86)UTF8_STRING
type for the property, we need to passXUTF8StringStyle
toXmbTextListToTextProperty
instead ofXTextStyle