What is the correct way to test Unicode support in a Smalltalk implementation?

江枫思渺然 提交于 2019-12-08 20:38:25

问题


Given any Smalltalk flavor, how should I proceed to check if Unicode is supported? In case of not having support, how can I detect at which level is missing (VM, font, Converter, etc)?


回答1:


At the VM level you can try Character codePoint: 256 or Character codePoint: 65536 (some Smalltalks may use value: instead of codePoint: still). Converter APIs differ between dialects too, but chances are that if the VM supports Unicode so will the converters.

As far as I know, no Smalltalk fully supports Unicode algorithms (case-folding, character properties, etc.), but some may support bidirectional text. For example GNU Smalltalk gets that from free from GTK+ and Pango.




回答2:


I presume you mean to check manually for a particular flavor or flavors you intend to use, because I don't think there's any automated way. Two things spring to mind. First, read the documentation. Second, try typing some text with arbitrary unicode characters into a window and see if they display. If they do, you're fine. If they don't, then it's an interesting question whether the problem might be with input, fonts available on a particular platform, basic ability to represent the characters, or something else. You could also try looking up the APIs for working with particular encodings (Supports Unicode is a rather vague term) and try reading and writing a file containing some of these characters. Or you could ask somebody if the particular flavor you're interested in supports the particular features you want to use.

For VisualWorks the answer is probably yes, but it will depend on exactly what it is you want to do. For example, characters from right-to-left languages can be displayed, but text editing with them is not going to work very well.



来源:https://stackoverflow.com/questions/6886129/what-is-the-correct-way-to-test-unicode-support-in-a-smalltalk-implementation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!