我试图使用函数XLookupString
。 根据documentation,它应该返回一个Latin-1代码。我怎么能转换它或我应该使用什么,而不是这个函数,所以我得到一个UTF-8代码?XLookupString返回UTF-8代码(Latin-1到UTF-8)
回答
您需要阅读Xlib编程手册的第11章:google books link。您正在寻找XmbLookupString()
或XwcLookupString()
,但它们不是XLookupString()
的替代品。我不是这方面的专家,但这应该指向正确的方向。
直接手册页链接可能是更容易:http://www.xfree86.org/current/XmbLookupString.3.html http://www.xfree86.org/current/XwcLookupString.3.html – ephemient 2009-11-07 01:46:08
谷歌图书只是一个预览,但有一个[完整的在线版本](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
还有一个Xutf8 *功能家族可以用于此,具体来说,存在一个Xutf8LookupString()
。 X*LookupString man page
- 1. UTF8与Latin1的
- 2. 转换LATIN1到UTF8在C#
- 3. LATIN1到UTF8转换问题
- 4. Python将latin1转换为UTF8
- 5. UTF8 - > Latin1难度,PHP
- 6. 将latin1转换为UTF8
- 7. perl utf8从iso-8859-1编码返回不同的结果到javascript utf8编码
- 8. UTF8代码问题
- 9. 更改编码UTF8到UTF8 BOM与rebol
- 10. SOLR + Mysql:如何将utf8转换为latin1
- 11. latin1的MYSQL和UTF8后mysqldump的
- 12. 如何将mysql latin1转换为utf8
- 13. 将latin1转换为utf8的问题
- 14. MySQL将latin1数据转换为UTF8
- 15. 如何确定这是latin1还是utf8?
- 16. 将latin1字符串转换为utf8?
- 17. MySql varchar从Latin1更改为UTF8
- 18. 将数据从latin1更改为utf8
- 19. MySQL将表格从Latin1转换为utf8
- 20. opendir和readdir返回utf8
- 21. 同样UTF8代码的UITextView
- 22. 将utf8代码点字符串转换为utf8 <U+0161>转换为utf8
- 23. 到UTF8
- 24. 的PostgreSQL:编码“UTF8”字符在“LATIN1”在plperl存储过程
- 25. 使用latin1字符集编码UTF8数据
- 26. 字符编码“UTF8”的0xe28093具有“LATIN1”没有等效
- 27. 解码UTF8实体为UTF8 C++
- 28. C#UTF8编码
- 29. UTF8编码/€
- 30. C++ UTF8编码
的可能重复的[获取与X11显示UTF-8输入(http://stackoverflow.com/questions/18246848/get-utf-8-input-with-x11-display) – 2014-02-11 04:29:11