开发者

iPhone - Chinese text as codepoints rather than characters

开发者 https://www.devze.com 2023-03-19 16:55 出处:网络
This post describes basics of loading Chinese in iPhone apps. However, while I have no difficulty inserti开发者_如何学JAVAng characters encoded as characters, I have not figured out how to use codepoi

This post describes basics of loading Chinese in iPhone apps. However, while I have no difficulty inserti开发者_如何学JAVAng characters encoded as characters, I have not figured out how to use codepoints alone. Any suggestions?

For instance, if I insert 狗不理包 into a label, it displays correctly, but if I insert the equivalent string 狗不理包 , all I get is the 32 ASCII characters. What do I need to do to make codepoints display as Chinese?

EDIT: to show codepoint-string as such, not as characters.


Use this :

 NSString *s = [NSString stringWithUTF8String:"狗不理包"];

I hope it helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号