> No, it would probably be to highlight that range of the string in a text
view, which does require knowing the character range.

Maybe you could take each of the ranges returned and create a string from
the UTF8 byte stream; search for it in the original string; the results
giving you the range for that string.
Another option could be to rebuild the string from the UTF8 string, noting
the ranges (in the new NSString).



On Tue, May 6, 2014 at 9:13 AM, Jens Alfke <j...@mooseyard.com> wrote:

>
> On May 5, 2014, at 10:19 PM, Stephen J. Butler <stephen.but...@gmail.com>
> wrote:
>
> > What's your next step after doing the UTF8 to UTF16 range conversion? If
> it's just going to be -[NSString substringWithRange:] then I'd strongly
> suggest just doing -[NSString initWithBytes:length:encoding:] on the UTF8
> string.
>
> No, it would probably be to highlight that range of the string in a text
> view, which does require knowing the character range.
>
> (I can’t say for sure because I’m implementing a library, not an app, so
> 3rd party apps will be the ultimate users of this information. But since
> this functionality is about text search, it’s very likely they’d be
> displaying the hit range to the user.)
>
> —Jens
>
> _______________________________________________
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/unmarked%40gmail.com
>
> This email sent to unmar...@gmail.com
>



-- 
Mark Munz
unmarked software
http://www.unmarked.com/
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to