Re: using UTF-32 in NSString.

2010-06-29 Thread John Engelhart
On Sun, Jun 27, 2010 at 5:18 PM, Georg Seifert wrote: > Hi, > > Does anyone has information on how to use Unicode code points higher than > 0x. > I need to add some supplementary multilingual plane code points to a > NSString. > > I can use something like this: >NSString *aString = @"

Re: using UTF-32 in NSString.

2010-06-28 Thread Aki Inoue
CFStringGetSurrogatePairForLongCharacter is an inline function. You can just copy the definition to your project (with warning once your baseline become SL and later). Aki On Jun 28, 2010, at 3:17 PM, Georg Seifert wrote: > >> You can do something like this: >> UniChar characters[2]; >> CFI

Re: using UTF-32 in NSString.

2010-06-28 Thread Georg Seifert
> You can do something like this: > UniChar characters[2]; > CFIndex length = (CFStringGetSurrogatePairForLongCharacter(0x1ABCD, > characters) ? 2 : 1); > > CFStringCreateWithCharacters(NULL, characters, length); > > Aki Is there anything like this in Leopard. This functions are new in Snow Le

Re: using UTF-32 in NSString.

2010-06-27 Thread Clark Cox
On Sun, Jun 27, 2010 at 2:18 PM, Georg Seifert wrote: > Hi, > > Does anyone has information on how to use Unicode code points higher than > 0x. > I need to add some supplementary multilingual plane code points to a NSString. > > I can use something like this: >        NSString *aString = @"\\

Re: using UTF-32 in NSString.

2010-06-27 Thread Greg Guerin
Georg Seifert wrote: Does anyone has information on how to use Unicode code points higher than 0x. NSString is UTF-16. Use surrogate pairs. -- GG ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

Re: using UTF-32 in NSString.

2010-06-27 Thread Aki Inoue
Georg, NSString/CFString is conceptually an object wrapping around UTF-16 character array (just like many other string objects). The length 2 returned from your example is, thus, the expected behavior. When you're creating a string with Universal Character Names that containing non-BMP points