Quote Originally Posted by Eduardo- View Post
VB6 stores the strings in memory using UTF-16.
This is the controversial part. Can a compiler *store* a string using UTF-16? AFAIK the compiler *stores* strings in the compiled PE image as BSTRs i.e. "wide" chars (2-bytes), length prefixed *and* null terminated. Second part is "dynamic" strings produced at run-time with concatenation for instance ("a" & "b") or whatever -- the compiler emits code that uses OS supplied SysStringXxx functions to allocate/free (dynamic memory management) BSTRs.

What MS did with its documentation for SysStringLen when transitioning OS to UTF-16 for instance was that instead of documenting it to return string length, they changed it to say it return number of string "code units" or similar. Of course as VB's Len function documentation is not updated correspondingly so we are left to figure out if BSTRs are UTF-16 or still UCS-2 on our own.

cheers,
</wqw>