Please clarify for me, how does UTF16 work? I am a little confused, considering these points:
Windows' WCHAR
is 16 bits (2 bytes) long.
A Unicode codepoint may be represented by one or two of these WCHAR
– 16 or 32 bits (2 or 4 bytes).
wcslen
returns number of WCHAR
units in a wide string, while wcslen_l
returns the number of (locale-dependent) codepoints. Obviously, wcslen <= wcslen_l
.
A Unicode character may consist of multiple combining codepoints.