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

From: Frank Yung-Fong Tang (
Date: Mon Mar 01 2004 - 15:47:54 EST

  • Next message: Philippe Verdy: "Re: What's in a wchar_t string on unix?"

    Rick Cameron wrote on 3/1/2004, 2:13 PM:

    Hi, all

    This may be an FAQ, but I couldn't find the answer on

    The reason is there are "NO answer" to the question you ask.

    It seems that most flavours of unix define wchar_t to be 4 bytes.

    Depend on which UNIX and which version. Depend on how you define "most flavours"

    If the locale is set to be Unicode, what's in a wchar_t string?

    No answer for that because
    1) ANSI C standard does not define it. (neither it's size nor it's content)
    2) Several organization try to establish standard for Unix. One of that is "The Open Group"'s "Base Specifications" IEEE Std 1003.1, 2003. But neither that define what should wchar_t hold.

    Is it UTF-32, or UTF-16 with the code units zero-extended to 4 bytes?


    - rick cameron

    The more interesting question is, why do you need to know the answer of your question. And the ANSI/C wchar_t model basically suggest, if you ask that question, you are moving to a wrong direction....

    This archive was generated by hypermail 2.1.5 : Mon Mar 01 2004 - 16:28:34 EST