News for hackers. Stuff that matters.
Re:The string type is broken (2013) by natanbc on Tuesday June 22, 2021 @10:00PM (#27599918)
It does for multi-codepoint characters (such as the rainbow flag): https://play.rust-lang.org/?version=stable&mode=debug&editio...

Elixir gets it right: https://replit.com/@natanbc/reverse

Re:The string type is broken (2013) by brundolf on Tuesday June 22, 2021 @10:03PM (#27599935)
Yeah, another commenter mentioned grapheme-clusters, though apparently there's a readily available crate that adds support: https://stackoverflow.com/questions/58770462/how-to-iterate-...

According to this they added it to the standard library at one point but then broke it back out because the lookup tables were too large

Re:The string type is broken (2013) by pjgalbraith on Tuesday June 22, 2021 @10:32PM (#27600131)