views:

157

answers:

3

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 sequences 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!

+2  A: 

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.

Joshua Weinberg
You mean \, right?
Peter Hosey
Thats what I get for typing on my phone. Yes, I mean \
Joshua Weinberg
Thanks for the answer!
Michael Waterfall
A: 

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

Objective Interested Person
Thanks for the link, I'll have a read through it.
Michael Waterfall
A: 

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

Kevin Bomberry