From: Konstantin Ritt (ritt.ks@gmail.com)
Date: Mon Nov 22 2010 - 14:26:32 CST
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 <kenw@sybase.com>
> 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
>
>
>
>
This archive was generated by hypermail 2.1.5 : Mon Nov 22 2010 - 14:28:50 CST