Why is wchar_t
needed? How is it superior to short
(or __int16
or whatever)?
(If it matters: I live in Windows world. I don\'t
wchar_t is a bit of a hangover from before unicode standardisation. Unfortunately it's not very helpful because the encoding is platform specific (and on Solaris, locale-specific!), and the width is not specified. In addition there are no guarantees that utf-8/16/32 codecvt facets will be available, or indeed how you would access them. In general it's a bit of a nightmare for portable usage.
Apparently c++0x will have support for unicode, but at the current rate of progress that may never happen...