2009-11-06 17 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