|
-
Jan 2nd, 2020, 01:53 AM
#18
Fanatic Member
Re: chrw error 5
Eduardo:
Chr/Chr$/Asc calls the OS to do Unicode to ANSI conversion, possibly WideCharToMultiByte/MultiByteToWideChar with CP_ACP flag, so they are slower than ChrW/AscW.
Some VB6 functions call the OS, so UTF-16 support depends on the OS. For example, I believe that StrComp() calls the Win32 API function CompareString(), which has the same return value. StrConv() calls WideCharToMultiByte/MultiByteToWideChar, so again making VB6 support UTF-16 based on OS support.
So UTF-16 support in VB6 depends on the OS. If someone is picky, they can test if Chr/Chr$/Asc send surrogate pairs to Win32 API function, but I doubt that they do. So VB6 could be said that it supports UCS-2 because of Chr/Chr$/Asc limitation, but it left the door open to support UTF-16, because in certain cases(like StrComp/StrConv), it sends a pointer to the Unicode string buffer as is without alterations, so interpreting surrogate pairs is left to the OS. So a statement like "VB6 supports UTF-16" is an incomplete statement. It should be "VB6 supports UTF-16 based on OS support", like Windows 2000+.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|