[phobos] UTF-8 string slicing
benjamin at precisionsoftware.us
Fri Aug 19 19:58:34 PDT 2011
On 08/18/2011 02:21 AM, unDEFER wrote:
> D language specification says that it supports UTF-8 strings, but I can't
> find how to slice UTF-8 string by character index, not by bytes numbers.
> Why there is no simple slice function in std.utf like attached code?
BTW: your code is flawed. Feed it some of the stuff near the end of this
post and it will fail:
tl;dr; your code doesn't slice on characters but something called (IIRC)
code points. If you start worrying about diacritic (and many end user
will want you to)
you need to do a bunch more processing.
> Thank you in advance.
> phobos mailing list
> phobos at puremagic.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the phobos