Re:Grokking Python 3’s str
by nneonneo on Saturday January 14, 2017 @11:47AM
(#13399215)
I was sloppy in using the word "character" - strings are really sequences of codepoints. I've edited my post to reflect this. Of course, multiple codepoints may be needed to construct a single character, and that's by design.
[ Parent
| on HN ]
Re:Grokking Python 3’s str
by tannhaeuser on Saturday January 14, 2017 @12:25PM
(#13399418)
But has Python 3 Unicode-aware string-length rather than byte-length functions (+ substring, case-folding, character classification functions etc.) for dealing with this? If it hasn't then nothing really is achieved for the general case by switching to 4-byte or any other fixed-byte unit, including the case of dealing with HTML 5 text.
See also perlgeek's question.
Yes, Python 3 does have Unicode-aware functions, as demonstrated in the post (via slices).
Go and Rust also have very good Unicode support, in addition to Swift and (apparently) Perl 6 as mentioned above.