Re: How to convert a UTF-8 byte offset into an NSString character offset?
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