![]() ![]() ![]() Operations are all only possible with explicit acknowledgement Now, Rust is a systems programming language and it just wouldn’tĭo to have expensive grapheme segmentation operations all over I strongly feel that languages should be moving in thisĭirection, having defaults involving grapheme clusters. It gets rid of the misconceptionīut it doesn’t get rid of the misconception that user-perceived Now, a lot of languages by default are now using Unicode-awareĮncodings. PS1: some last-minute googling brought these take on code-points: User “don’t use those go find some crate if you want to handle textĬorrectly” defeats the point of a string type IMO. String type offering only bytes and code-points and telling the I still feel like this feature belongs in a language’s standard.Did I miss the rationale on why that feature died while in unstable?.Think of as units”): programs cannot rely on code-points to e.g.Ĭompute word widths and align text in a monospaced CLI, get theĬharacter next to the cursor and erase it in a GUI, … Other”), and grapheme clusters (“symbols that people can recognize and Representation between bytes (“bits that programs can send to each That last bit was tongue-in-cheek, but I seriously can’t think of a Their language helps them deal with non-ASCII text? code-points are useful to… lure programmers into wrongly believing.(display width, character string comparisons), grapheme clusters are useful to deal with meat-space problems.bytes are useful to deal with plumbing issues such as serialization,.Then again, maybe everyone is fine with grapheme cluster support On the other hand, design and code reviews may be time-consumingĮnough that the Rust team would rather focus its efforts on the Have time to push for a feature, it can find its way in despite On the one hand, I guess that as long as motivated volunteers Str, so maybe it can be brought back with minimal breakage?Īlthough I imagine that changes in the last 3 years might make thisĪlso, I don’t know how rigid Rust’s roadmap is What are the odds of this feature being resurrected?įrom what I understand, this pull-request mainly added methods to Seemed unaware that this pull-request even existed at some point,Īccepting that this functionality belongs in an external crate right On the menu in a recent-ish thread on, people “grapheme” among open issues and pull-requests do not suggest this is it was then removed during some “spring-cleaning” in 2015.it was merged in 2014, and the corresponding pull-request was.It implements exactly what the documentation is talking aboutĮxcept that it if I understand correctly: Iteration over grapheme clusters may be what you actually want.īut AFAICT “what I actually want” is not present in std.ĭigging further, I found this pull-request from 2014: it sounds like Value, and may not match your idea of what a ‘character’ is. It’s important to remember that char represents a Unicode Scalar Theĭocumentation for str mentions grapheme clusters briefly: Over/slice/count/interact with grapheme clusters in addition toĬode-points (. I was wondering whether Rust’s string types allowed us to iterate ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |