wchar
WCHAR is a Windows data type used to represent a single wide character in Windows API strings. It is defined as a typedef of wchar_t in the Windows headers (often in WinNT.h), and is widely used to denote Unicode code units stored as wide characters within Windows applications. The underlying size of WCHAR is platform dependent through wchar_t, but on Windows it is 16 bits, corresponding to UTF-16 code units. As such, a single WCHAR may represent a UTF-16 code unit and, for characters outside the Basic Multilingual Plane, may form surrogate pairs when composing actual code points.
In practice, WCHAR is used for wide-character strings, where arrays of WCHAR hold null-terminated sequences. Literals
WCHAR is conceptually aligned with the C standard type wchar_t, and in Windows they are effectively the
Because Windows uses UTF-16 encoding for wide strings, supplementary characters are represented using surrogate pairs. Converting