Re:Unicode is harder than you think
by jkaptur on Tuesday July 25, 2023 @04:56PM
(#36869388)
The logical next step here is to realize that if you want to be truly internationalized, pretty much every single method of the string class in your favorite language is an antipattern and should be used with extreme caution. Seriously!
[ Parent
| on HN ]
I _think_ Swift did it properly. At least that’s what they claim[1]
[1]: https://www.swift.org/blog/utf8-string/
There were many discussions on how to handle strings in the forums too. Remarkably, it is not possible to access "abc"[1] as it has unpredictable performance; instead one has to build the index and making this should make the developer realize the operation is costly. All in all most beginners in Swift hate working with strings because it’s not intuitive at first, but to be fair in almost all languages strings handling is not done properly.