This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: 4 byte wchar_t and portability


> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]