4 ms·
Rust separates this out; the standard library gives you bytes and Unicode Scalar Values. Grapheme cluster stuff is in a package on Cargo, maintained by the Serv
by steveklabnik 10y ago
Rust separates this out; the standard library gives you bytes and Unicode Scalar Values. Grapheme cluster stuff is in a package on Cargo, maintained by the Servo team.
- bquinlan 10y agoYou can iterate over Grapheme clusters using the standard library: https://doc.rust-lang.org/1.3.0/std/str/struct.Graphemes.html https://doc.rust-lang.org/1.3.0/std/str/struct.Graphemes.htm...
- steveklabnik 10y agoThose are unstable docs for 1.3; they don't exist in today's Rust.
- jacobush 10y agoSounds like Rust follows in the tradition of C. Like you now always hear about hos C has no string type, just a bunch of char, will we hear in the future that, alas, Rust has no native support for grapheme clustering?
- steveklabnik 10y agoThe issue is, there's multiple ways to do the clustering, in my understanding. We picked the most core thing to be our most core thing. Text is hard.
- jacobush 10y agoOh I get it didn't want to come across as flippant. Indeed text is hard.
- perlgeek 10y agoIf you rely on libraries, there are ICU libraries for C and Java too, see for example http://userguide.icu-project.org/boundaryanalysis http://userguide.icu-project.org/boundaryanalysis