This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: 4 byte wchar_t and portability
- To: sb at metis dot no
- Subject: Re: 4 byte wchar_t and portability
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Tue, 21 Dec 1999 11:39:37 +0100
- CC: libstdc++ at sourceware dot cygnus dot com
- References: <whvh5s3fey.fsf@viffer.metis.no>
> I take it that making sizeof(wchar_t)=4 in gcc 3.0 is pretty much a
> given?
It depends on the platform. For svr3, svr4, Linux, and others, it is
given, for win32, sizeof(wchar_t) is 2.
> I didn't know of it until two weeks ago, and it creates problems for
> my use of SAX (Simple API for XML) for C++ on my different platforms:
> MSVC++ and gcc on linux if they chose wstring or wchar_t to store the
> data.
>
> In that case I will have UTF-16 stored into something that could hold
> UCS-4 (was probably made this large for that purpose?), and there is
> no way for me to make things more efficient without ugly hacks.
What exactly do you want to make more efficient? Representing UCS-4
data in a 2-byte wchar_t using UTF-16? You should complain to
Microsoft, then.
Regards,
Martin