开发者

Understanding Unicode composed character sequences within an NSString

I'm trying to understand NSString's and the complexities regarding composed character sequences. I'm having troubles creating strings containing these composed character sequences for me to be able to play around with them.

I've seen the Unicode list of seque开发者_运维百科nces but I'm unable to find these characters in the Mac OS X character selector in order for me to insert them into Xcode as an NSString literal. Am I understanding something incorrectly?

Any advice would be much appreciated!


You shouldn't insert these directly into a string literal, this will cause the compiler to give a warning. Use the unicode escape sequences, @"\u0104\u0301" should do what you want.


I just thought I'd chime in here. Don over at Able Pear Software has been doing a series of articles, Objective-C Tuesdays, on their blog and part of the String series talks about NSString and Unicode string literals.

Here's the link: http://blog.ablepear.com/2010/07/objective-c-tuesdays-unicode-string.html


FYI:

http://developer.apple.com/mac/library/qa/qa2001/qa1235.html Yes, a bit old. But there should be more! CFStringNormalize (for example) proofes it.

You know, OS X does normalization, Linux does not (so there can sit some files in one directory, looking as having identical names; try to remove or rename “this one”! Other OS? If it isn’t mentioned in the documentation, they may not use unicode (at least for the file systems). Or they may be troublemakers.

BTW: normalization != normalization: do they split the codes or do they merge them?

Greetings

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜