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

From: Antoine Leca (
Date: Tue Mar 02 2004 - 14:01:58 EST

  • Next message: Asmus Freytag: "Re: LATIN SMALL LIGATURE CT"

    Hi Frank,

    Sorry to be in disagreement on a couple of points.

    On Tuesday, March 02, 2004 5:54 PM, Frank Yung-Fong Tang wrote:

    > Antoine Leca wrote on 3/2/2004, 5:50 AM:
    > > Rick Cameron asked:
    > >
    > > > If the locale is set to be Unicode,
    > >
    > > That part is highly suspect.
    > > Since you write that, you already know the wchar_t encoding
    > > (as well as char one) depends on the locale setting.
    > no, not true.

    What is not true?

    > the wchar_t is depend on the COMPILER


    > and C LIB implementation,


    > not depend on the locale setting.

    Yes it does. That is, the wchar_t encoding CAN change at run time if you
    call setlocale(LC_CTYPE, ...)

    I know this is not current behavour (fortunately), but it does happen with
    some libc. And regarding the standard, this IS allowed behaviour.

    > For example, wchar_t in MS Windows is defined by Microsoft

    In this particular example, yes, wchar_t encoding never changes (and stays
    16-bit UCS-2).

    But there are other compilers and other environments in the world.

    > But again, that is defined by who wrote gcc and gnu version of lib c.

    This I agree with. Particularly the latter...

    > It is NOT locale dependent (unless a particular c lib implementaion
    > define so)

    Here I am in agreement!

    About the rest, this is factually correct. I am in disagreement with the
    ideas, but I already exposed mine, so no need to repeat it.


    This archive was generated by hypermail 2.1.5 : Tue Mar 02 2004 - 14:41:51 EST