All of the string functions listed in this section exist in A and W versions to support ANSI and Unicode arguments.
The following string functions do not require special comment; their ANSI and Unicode versions work identically:
CharNext
CharPrev
lstrcat
lstrcpy
lstrlen
The value returned by lstrlen is always the number of characters; that is, lstrlenA(“hello world”) == lstrlenW(L“hello world”);
The following string functions are sensitive to the language of the current thread (which is derived from the language the user selects in Control Panel). The lstrcmp and lstrcmpi functions do not perform byte comparisons like their ANSI C namesakes, but compare strings according to the rules of the selected language.
CharUpper
CharUpperBuff
lstrcmp
lstrcmpi
The following functions convert between the OEM character set and either ANSI or Unicode, depending on whether the A or W version is used:
CharToOem
CharToOemBuff
OemToChar
OemToCharBuff
The print function wsprintf provides the following new types in its format specifications to support Unicode:
Character sequence | Meaning |
ts | Insert a generic string; that is, a Unicode character string if wsprintf was compiled with the #define UNICODE compile flag, or ANSI otherwise. |
tc | Insert a generic character; that is, a single Unicode character if wsprintf was compiled with the #define UNICODE compile flag, or ANSI otherwise. |
ws | Insert a Unicode string. |
wc | Insert a Unicode character. |
The format string for the W version of wsprintf is Unicode, as is the resulting output text.