Low level functions in the Win32 API are not concerned with the user notion
"Jochen Kalmbach [MVP]" <nospam-Jochen.Kalmbach@holzma.de> wrote in message
news:%23do34iIqFHA.3404@TK2MSFTNGP11.phx.gbl...
> Hi!
>
> I think the MSDN docu uses in many places the word "characters" while it
> really means "codepoint".
>
> For example the docu of "MultiByteToWideChar":
>
> <quote>
> Parameter "cchWideChar":
> Specifies the size, in wide characters...
> </quote>
>
> There are no such thing like "wide characters"; there are only
> characters...
> But it should realy state "(wide) codepoints".
>
> Also the retrun value uses the word "wide characters" which is also
> confusing...
>
> Here is a simple example:
>
> char utf8[] = {0xF0, 0x90, 0x8C, 0xB0, 0x00}; // GOTHIC LETTER AHSA
> (0x10330)
> wchar_t utf16[100];
> int iRet = MultiByteToWideChar(CP_UTF8, 0, utf8, -1,
> utf16, sizeof(utf16)/sizeof(wchar_t));
>
>
> This is only *one* character but it has *two* codepoints in UTF16.
>
> The expected return value should be 2 (1 character and terminating NUL).
> But it returns 3 (2 codepoints and terminating NUL).
>
>
>
> So at least it is very unclear in which case the docu really means
> "characters" and which it really means "codepoint".
>
>
> --
> Greetings
> Jochen
>
> My blog about Win32 and .NET
>
http://blog.kalmbachnet.de/