Glad to see Ken's advice here about avoiding macros, avoiding wchar_t, and using typedefs to define types with exact widths ... I especially had always wondered what one was supposed to do with the "wchar_t" type ...
- Ed On Mon, Nov 22, 2010 at 2:34 PM, Kenneth Whistler <[email protected]> wrote: > > 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 > > ... < ... SNIPPED ... > ... >

