• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: String encoding details was: controlTextDidChange, backspace possible?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: String encoding details was: controlTextDidChange, backspace possible?
      • From: Andreas Mayer <email@hidden>
References: 
 >controlTextDidChange, backspace possible? (From: "Peter Karlsson" <email@hidden>)
 >Re: controlTextDidChange, backspace possible? (From: j o a r <email@hidden>)
 >Re: controlTextDidChange, backspace possible? (From: Frederick Cheung <email@hidden>)
 >Re: controlTextDidChange, backspace possible? (From: Andreas Mayer <email@hidden>)
 >Re: controlTextDidChange, backspace possible? (From: Frederick Cheung <email@hidden>)
 >Re: controlTextDidChange, backspace possible? (From: Andreas Mayer <email@hidden>)
 >Re: controlTextDidChange, backspace possible? (From: Frederick Cheung <email@hidden>)
 >String encoding details was: controlTextDidChange, backspace possible? (From: Andreas Mayer <email@hidden>)

  • Prev by Date: Breaking source file into multiple files?
  • Next by Date: Re: Breaking source file into multiple files?
  • Previous by thread: String encoding details was: controlTextDidChange, backspace possible?
  • Next by thread: Re: String encoding details was: controlTextDidChange, backspace possible?
  • Index(es):
    • Date
    • Thread