2009-11-06 20 views
0

我试图使用函数XLookupString。 根据documentation,它应该返回一个Latin-1代码。我怎么能转换它或我应该使用什么,而不是这个函数,所以我得到一个UTF-8代码?XLookupString返回UTF-8代码(Latin-1到UTF-8)

+0

的可能重复的[获取与X11显示UTF-8输入(http://stackoverflow.com/questions/18246848/get-utf-8-input-with-x11-display) – 2014-02-11 04:29:11

回答

1

您需要阅读Xlib编程手册的第11章:google books link。您正在寻找XmbLookupString()XwcLookupString(),但它们不是XLookupString()的替代品。我不是这方面的专家,但这应该指向正确的方向。

+1

直接手册页链接可能是更容易:http://www.xfree86.org/current/XmbLookupString.3.html http://www.xfree86.org/current/XwcLookupString.3.html – ephemient 2009-11-07 01:46:08

+0

谷歌图书只是一个预览,但有一个[完整的在线版本](http://menehune.opt.wfu.edu/Kokua/Irix_6.5.21_doc_cd/usr/share/Insight/library/SGI_bookshelves/SGI_Developer/books/XLib_PG/sgi_html/ch11.html) - 显然两者之间只有“小修改”,谷歌的版本是3岁左右。 – 2013-07-17 13:03:30