3 ms·
Why would I want this to be 17, if I'm representing strings as array of code points, rather than UTF-8? TXR Lisp: 1> (len " ") 5 2> (coded-length " ")
by kazinator 1y ago
Why would I want this to be 17, if I'm representing strings as array of code points, rather than UTF-8?
TXR Lisp:
1> (len " ")
5
2> (coded-length " ")
17
(Trust me when I say that the emoji was there when I edited the comment.)
The second value takes work; we have to go through the code points and add up their UTF-8 lengths. The coded length is not cached.