unsigned short arrays can be used with wide character strings - for example, if you have UTF-16 encoded texts, although I expected to see wchar_t in these cases. But they may have their own reasons, for example, compatibility between MacOS and Windows. (If my sources are right, MacOS wchar_t is 32 bits and Windows is 16 bits.)
You convert between two types of strings by calling the appropriate library function. Which function is appropriate depends on the situation. Doesn't the SDK come with one?
And char instead of unsigned char , well, all strings have always been historically defined using char , so switching to unsigned char will lead to incompatibility.
(Switching to signed char will also cause incompatibility, but somehow not much ...)
Edit Now the question has been edited, let me say that I did not see the changes before I typed my answer. But yes, UInt16 is a better representation of a 16-bit entity than wchar_t for the above reason.
source share