← Back to context

Comment by lelanthran

13 hours ago

> If you only need the byte count then even you can use strlen no matter what the encoding is.

No, strlen won't give you the byte count on UTF16 encodings.

> If you need character count then you don't use strlen no matter what the encoding is (except in ASCII only environment).

What use-case requires the character count without also requiring a unicode glyph library?

> strlen won't give you the byte count on UTF16 encodings.

You're right. I stand corrected.