问题描述
我在Windows XP上使用Hello World测试wxHaskell:
但是当它在我的机器上运行时,所有文本都不显示。
例如,Quit只会显示Q。
任何想法?
您需要确保用于构建wxhaskell的wxWidgets启用了Unicode支持。我想你可以通过运行wx-config --libs --unicode来检查。
我认为wxWidgets期望获得简单的8位字符,但是接收宽32位字符。零被解释为空字符,即字符串终止符。启用Unicode支持为您提供了一个接受宽字符的wxWidgets。我不完全确定这个版本的故事是相当准确的,但我知道Unicode wxWidgets解决了这个问题。
在大多数Linux发行版中,我想, wxWidgets包已经支持Unicode。
在MacOS X上,捆绑的wxWidgets确实支持Unicode,但不幸的是缺少一些与事件处理相关的必要功能。通过Homebrew(brew update; brew install wxmac)获得工作的wxWidgets最简单的方法。
我从来没有在Windows上尝试过wxhaskell,但其他人都有。
I'm testing wxHaskell on Windows XP using the "Hello World" here: http://www.haskell.org/haskellwiki/WxHaskell/Quick_start
But when it runs on my machine, all the text doesn't display.For instance, "Quit" will just display "Q".
Any Ideas?
You need to ensure that the wxWidgets used to build wxhaskell has Unicode support enabled. I think you can check by running wx-config --libs --unicode.
What I think is happening is that wxWidgets is expecting simple 8 bit chars but is receiving wide 32 bit ones. The zeroes are interpreted as null characters, ie string terminators. Enabling Unicode support gives you a wxWidgets which accepts wide chars. I'm not entirely sure this version of the story is quite accurate, but I do know that Unicode wxWidgets solves the problem.
On most Linux distributions, I imagine, the wxWidgets package already has Unicode support.
On MacOS X, the bundled wxWidgets does have Unicode support but is unfortunately missing some necessary features related to event handling. The easiest way to get a working wxWidgets is through Homebrew ( brew update; brew install wxmac ).
I have never tried wxhaskell on Windows but others have.
这篇关于wxHaskell标签无法显示全文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!