NSString
is pretty unicode friendly. So normally when I want to create a string containing unicode, I can pop it directly into a string literal like so:
NSString *myString = @"Press ⌘Q to quit…";
But that doesn't work with using a line separator (AKA:
NSLineSeparatorCharacter
, Unicode U+2028, UTF-8 E2 80 A8). The compiler (correctly) interprets this as a line break, which is a no-no in C syntax.
-stringWithFormat:
doesn't help either. Trying
NSString *myString = [NSString stringWithFormat@"This is%don two lines…", NSLineSeparatorCharacter];
gives me the string "This is8232on two lines…".