4 ms·
While you can technically store whatever you want in there, the assumption and convention the bytes in a string in Go will be utf8. E.g.: for i, x := range
by dilap 11y ago
While you can technically store whatever you want in there, the assumption and convention the bytes in a string in Go will be utf8.
E.g.:
for i, x := range someString // iterates unicode code points
Works well in practice. (There are the unicode and unicode/norm packages to do more complex unicode operations.)
- ridiculous_fish 11y agoI don't think it works well for text manipulation. For example, in Go, how would you truncate a string and add ellipsis, without dropping an accent or otherwise splitting a grapheme cluster?