3 ms·
> Is "fi" a single character? [...] "Ȣ"? "IJ"? I don't know these, someone who does could properly tell you. The implementation could fallback to "glyph" or "co
by jhasse 5y ago
> Is "fi" a single character? [...] "Ȣ"? "IJ"?
I don't know these, someone who does could properly tell you.
The implementation could fallback to "glyph" or "codepoint" (don't know what those are exactly) if it is unsure. Mostly right is better than nearly always wrong (= returning number of bytes) IMHO.
> How about "ß"?
That's one character.
> When programmers get answers to these questions wrong, the code that they write ends up being broken for someone out there.
So? Returning the number of bytes would also be wrong.
Renaming len to len_glyphs will just result in most programmers typing more and some accidentally using len_utf8_bytes (returns the number of bytes?) where len_glyphs would be less wrong.