I have a Unicode string and I need to know the number of bytes it uses.
In general, I know that wcslen(s) * 2
will work. But my understanding is that this is not reliable when working with Unicode.
Is there a reliable and performant way to get the number of bytes used by a Unicode string?