News for hackers. Stuff that matters.
Re:A string of unexpected lengths by panic on Friday February 20, 2015 @06:45PM (#9083866)
Swift's String class (https://developer.apple.com/library/ios/documentation/Swift/...) uses extended grapheme clusters as characters. If you need the raw Unicode scalars or UTF-16/UTF-8 code units, there are separate "views" into the string that let you iterate over these.

Using extended grapheme clusters as characters means truncation, concatenation, length measurement and transformations like reversal all work in the expected way, even in the presence of combining characters. More standard libraries should consider adopting this model!

Re:A string of unexpected lengths by thomasballinger on Saturday February 21, 2015 @12:51PM (#9086195)
How do you find this in practice? I mention this in the 3rd footnote of the post, but didn't have much to say about it because I haven't used it myself. The one person I've talked about this says it's rather awkward right now because Swift doesn't provide great tools for working with these objects.
Re:A string of unexpected lengths by TheLoneWolfling on Saturday February 21, 2015 @11:15AM (#9085860)
So does Swift use a rope? Or is getting the Nth character of a string O(n) time?