Re: What's in a wchar_t string on unix?

From: Clark Cox (
Date: Wed Mar 03 2004 - 13:28:53 EST

  • Next message: Nelson H. F. Beebe: "Re: What's in a wchar_t string ..."

     From the C standard:

    __STDC_ISO_10646_ _An integer constant of the formyyyymmL(for example,
    199712L), intended to indicate that values of type wchar_t are the
    coded representations of the characters defined by ISO/IEC10646, along
    with all amendments and technical corrigenda as of the specified year
    and month.

    This, to me suggests that wchar_t would indeed be a 32-bit type (well,
    at least a 20-bit type) when this macro is defined. However, to be
    sure, I'd suggest posting to news:comp.std.c

    On Mar 03, 2004, at 12:38, Frank Yung-Fong Tang wrote:

    > oh. This is the first time I hear about this. Thanks about your
    > information. Does it also mean wchar_t is 4 bytes if __STDC_ISO_10646__
    > is defined? or does it only mean wchar_t hold the character in
    > ISO_10646
    > (which mean it could be 2 bytes, 4 bytes or more than that?)
    > Noah Levitt wrote on 3/2/2004, 1:33 PM:
    >> As specified in C99 (and maybe earlier), if the macro
    >> __STDC_ISO_10646__ is defined, then wchar_t values are ucs4.
    >> Otherwise, wchar_t is an opaque type and you can't be sure
    >> what it is.
    >> Noah

    Clark S. Cox III

    This archive was generated by hypermail 2.1.5 : Wed Mar 03 2004 - 14:12:27 EST