4 ms·
> Firstly we live in a world where limiting yourself to ASCII characters is increasingly untenable. I agree. But your original comment bemoaned the difference
by rcme 3y ago
> Firstly we live in a world where limiting yourself to ASCII characters is increasingly untenable.
I agree. But your original comment bemoaned the difference between using ASCII and Unicode encodings. I was just pointing out that any Unicode encoding is not variable length of you limit yourself to ASCII. This applies to all Unicode encodings, not just utf-8.
- bruce511 3y agoI might not have been clear in the original posting. I wasn't intending to bemoan the difference, I was bemoaning old programmers (like me) not being familiar with the most basic unicode concepts, which leads to lots of issues. Yes, if you limit your strings to ASCII then they are always 1 byte long (utf-8), or 2 bytes long (utf-16) or 4 bytes long (utf-32). So you still need to know which encoding is in play. But you can then randomly access "the 4th character". My follow up points out though that this is meaningless. Because in the real world you cannot limit your strings to just ASCII in the first place. So your point is moot from that perspective.