completely agreed. macroses are evil in such use case. the common practice is to typedef code units to exact-width integer types.
Konstantin 2010/11/22 Kenneth Whistler <[email protected]> > Well, some may disagree with me, but my first advice would be > to avoid macros like that altogether. And second, to absolutely > avoid any use of wchar_t in the context of processing Unicode > characters and strings. > > If you are working with C compilers that support the C99 standard, > you can instead make use of the stdint.h exact-width integer > types. And then you should *typedef* Unicode code unit types > to those exact-width integer types. > > uint8_t <-- typedef your UTF-8 code unit type to this > > uint16_t <-- typedef your UTF-16 code unit type to this > > uint32_t <-- typedef your UTF-32 code unit type to this > > <snip> > > --Ken > > > >

