4 ms·
Hi, I'm one of the people who are library authors in this area. This article is very specific to Perl, and the way it does so is also subject to question - it
by neonsunset 2y ago
Hi, I'm one of the people who are library authors in this area.
This article is very specific to Perl, and the way it does so is also subject to question - it does not look efficient.
You will be better off by reading excellent wikipedia page on UTF-8: https://en.wikipedia.org/wiki/UTF-8 https://en.wikipedia.org/wiki/UTF-8
Now, extended grapheme cluster enumeration is much more complex than finding the next non-continuation byte (or counting such), but to perform those correctly you would ultimately end up reading the official spec at unicode.org and perusing reference implementations like ICU (which is painful to read) or from standard library/popular packages for Rust/Java/C#/Swift (the decent ones I'm aware of, do not look at C++).