• 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: How to convert a UTF-8 byte offset into an NSString character offset?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to convert a UTF-8 byte offset into an NSString character offset?


  • Subject: Re: How to convert a UTF-8 byte offset into an NSString character offset?
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 06 May 2014 16:13:37 -0700

On May 6, 2014, at 11:12 AM, Quincey Morris <email@hidden> wrote:

> I’ve been thinking about this since your original question, and it seems to me that this is a subtler problem than it seems:

No offense, but I think you’re overanalyzing it. Remember I said that the UTF-8 data was generated from an NSString via -dataUsingEncoding:, so it’s going to have the same structure as the UTF-16 in the string.

> 3. It’s *possible* that you can create a NSString that has the same code points in the same order as the UTF-8 string

I’m not creating an NSString. The client already has an NSString and is asking for character range in that string.

—Jens
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >How to convert a UTF-8 byte offset into an NSString character offset? (From: Jens Alfke <email@hidden>)
 >Re: How to convert a UTF-8 byte offset into an NSString character offset? (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Auto layout and re-sizing subviews.
  • Next by Date: Re: Document being reopened on launch during modal dialog
  • Previous by thread: Re: How to convert a UTF-8 byte offset into an NSString character offset?
  • Next by thread: Re: How to convert a UTF-8 byte offset into an NSString character offset?
  • Index(es):
    • Date
    • Thread