如何指定处理 iPhone 上宽字符的系统字体?
由于我缺乏字体方面的经验,这是一个通用问题,因此,请耐心等待和/或指出正确的方向以获取更多信息,我们将不胜感激。我有一个 iPhone 应用程序,我注意到当我在标签上打印一些文本时,当字符串包含非 ASCII 字符(例如韩语)时,我最终会得到垃圾。
我的猜测是,例如,由于我的 UILabels 使用系统字体,因此系统字体可能不支持显示宽字符。但是,我还有一些初学者问题:
1)如何设置系统字体,以便我的 iphone sdk 对象使用系统字体使用它?
2) 这听起来是否正确,系统字体可能不支持宽字符,这就是当我的字符超出正常 ascii 范围时我看到垃圾的原因吗?
谢谢。如果我需要澄清问题,请告诉我。
更新: 我后来怀疑这可能是我的服务器端的问题,所以在这里发布了这个相关但不完全相同的帖子:Google 应用引擎在 StringProperty v StringListProperty 对象中显示的 unicode 是否不同?
This is sort of a generic question due to my lack of experience with fonts, so a little patience and/or pointing in the right direction to get more info would be appreciated. I have an iphone app and am noticing that when I print some text on my labels, I end up with garbage when the string contains non-ascii, like Korean for example.
My guess is that since my UILabels, for instance, are using the system font, perhaps the system font does not support displaying wide characters. However, I'm left with a few beginner questions:
1) How do I set the system font so my iphone sdk objects that use the system font use it?
2) Does this sound correct that the system font probably doesn't support wide characters and is the reason I see garbage when I have characters out of the normal ascii range?
Thanks. Let me know if I need to clarify the problem please.
Update:
I later suspected maybe it was a problem on my server end so posted this related but not identical post here: does google app engine display unicode differently in StringProperty v StringListProperty objs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,问题不在于字体,而在于我本应该使用 UTF8,但错误地将来自服务器的数据响应编码为 Ascii。看来字体一开始就支持unicode。
It turns out the problem was not with the font, but with improperly encoding the data response from the server into Ascii when I should have used UTF8. It appears the font supported unicode to begin with.