Re: String encoding details was: controlTextDidChange, backspace possible?
Re: String encoding details was: controlTextDidChange, backspace possible?
- Subject: Re: String encoding details was: controlTextDidChange, backspace possible?
- From: Aki Inoue <email@hidden>
- Date: Tue, 14 Sep 2004 19:07:17 -0700
Now, Really. What API would one use to handle those cases?
For NSString,
-rangeOfComposedCharacterSequenceAtIndex:
For CFString,
CFStringGetRangeOfComposedCharactersAtIndex().
With both cases, you pass a particular character index. The return
value is a range of characters "surrounding" the original index that
should be handled atomically.
They both handle all Unicode "oddities" such as surrogate pairs,
combining marks, indic virama, hangul composition, transcoding hints,
etc, etc.
Aki
On 2004/09/14, at 18:48, Andreas Mayer wrote:
Am 15.09.2004 um 03:11 Uhr schrieb Frederick Cheung:
16bits isn't actually enough to encode all unicode characters.
I know.
Any character whose unicode scalar value is > 0xFFFF is represented
as a surrogate pair.
But wouldn't that be an implementation detail of the encoding? I would
have expected that I'm not even able to get to these without using
some sub-string level stuff.
I'm not 100% sure if it's nonsensical or illegal.
Well, Douglas already confirmed that the text system will be able to
handle it. That's good enough for me. :)
Now, Really. What API would one use to handle those cases?
Andreas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden