4 ms·
If you're fine with an extra copy, I think the UTF8PROC_CHARBOUND flag does this in https://github.com/JuliaStrings/utf8proc https://github.com/JuliaStrings/utf
by remexre 5y ago
If you're fine with an extra copy, I think the UTF8PROC_CHARBOUND flag does this in https://github.com/JuliaStrings/utf8proc https://github.com/JuliaStrings/utf8proc ?
- boxfire 5y agoNice this does the job, probably could be done more efficiently, but I like that its not a kitchen-sink library. Unfortunate that the data generator is certainly not "clean C"... perl, ruby, and julia, all to generate character width table? Ugh. Otherwise this lib does a pretty good job. Thanks for the reference! edit* Yikes https://github.com/JuliaStrings/utf8proc/blob/master/utf8proc.h#L554 https://github.com/JuliaStrings/utf8proc/blob/master/utf8pro... Still this is a good template to maybe cut a (safter) state-based iterator out of their logic...