Re: UNICODE version of _T(x) macro

From: Ed (ed.trager@gmail.com)
Date: Mon Nov 22 2010 - 14:53:08 CST

  • Next message: sowmya satyanarayana: "Re: UNICODE version of _T(x) macro"

    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 <kenw@sybase.com> 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 ... > ...
    >



    This archive was generated by hypermail 2.1.5 : Mon Nov 22 2010 - 14:56:24 CST