This is the mail archive of the
mailing list for the GDB project.
Re: [RFA-v2] Handle cygwin wchar_t specifics
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: jan dot kratochvil at redhat dot com, tromey at redhat dot com, gdb-patches at sourceware dot org
- Date: Mon, 18 Apr 2011 13:56:31 +0300
- Subject: Re: [RFA-v2] Handle cygwin wchar_t specifics
- References: <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <20110416162455.GA5599@host1.jankratochvil.net> <email@example.com> <firstname.lastname@example.org> <email@example.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: "Pierre Muller" <firstname.lastname@example.org>
> Cc: <email@example.com>, <firstname.lastname@example.org>, <email@example.com>
> Date: Mon, 18 Apr 2011 12:35:26 +0200
> > > -/* If __STDC_ISO_10646__ is defined, then the host wchar_t is UCS-4.
> > > +/* If __STDC_ISO_10646__ is defined, then the host wchar_t is UCS-4 or
> > UCS-2.
> > Please use UTF-16, not UCS-2. What Windows uses is the former. The
> > latter is the old name from the days when Unicode covered only the
> > BMP; it was superseded by UTF-16 that covers more than that.
> Are you sure this is correct?
> I tried what you said, but "UTF-16" seems to mean "UTF-16BE"
> while UTF-16LE" seems to do a better job.
UTF-16 means both LE and BE varieties. I meant to use UTF-16 in the
comment, instead of UCS-2. In the code, you need to use the variety
that suits the endianness of the host platform.
> But if UTF-16 is better than UCS-2,
> shouldn't we also favor UTF-32 over UCS-4?
IMO, there's no need, since Unicode still didn't exceed 32 bits.