On 6/30/20 7:53 AM, M.-A. Lemburg wrote:
Since the C world has adopted wchar_t for this purpose, it's the
natural choice.
I would disagree with this comment. Microsoft Windows has chosen to use
'wchar_t' for Unicode, because they adopted UCS-2 before it morphed into
UTF-16 due to the expansion of Unicode above 16 bits. The *nix side of
the world has chosen to use UTF-8 as the preferred way to store Unicode
characters.
Also, in Windows, wchar_t doesn't really meet the requirements for what
C defines wchar_t to mean, as wchar_t is supposed to represent every
character as a single unit, and thus would need to be at least a 21 bit
type (typically, it would be a 32 bit type), but Windows makes it a 16
bit type due to ABIs being locked before the Unicode expansion.