[cfe-dev] Is that getting wchar_t to be 32bit on win32 a good idea for compatible with Unix world by implement posix layer on win32 API?
Szabolcs Nagy
nsz at port70.net
Sat May 9 03:36:45 PDT 2015
* John Sully <john at csquare.ca> [2015-05-09 00:55:12 -0700]:
> In my opinion you almost never want 32-bit wide characters once you learn
> of their limitations. Most people assume that if they use them they can
> return to the one character -> one glyph idiom like ASCII. But Unicode is
wchar_t must be at least 21 bits on a system that spports unicode
in any locale: it has to be able to represent all code points of the
supported character set.
in practice this means that the only conforming definition to iso c
(and thus posix, c++ and other standards based on c) is a 32bit wchar_t
(the signedness can be choosen freely).
so the definition is not based on what "you almost never want" or what
"most people assume".
if the goal is to provide a posix implementation then 16bit wchar_t
is not an option (assuming the system wants to be able to communicate
with the external world that uses unicode text).
More information about the cfe-dev
mailing list