On Tue, 5 Oct 2004, Scott Cantor wrote:
>
> > But you are right, Xerces internally uses
> > UTF-16 strings, and wchar_t isn't a cross-platform storage for
> > UTF-16. The point is that platforms that know this is true (like Windows)
> > would like to see XMLCh==wchar_t, even if they can just cast them to be
> > the desired type.
>
> I agree. The big advantage of this is that this:
>
> basic_string<XMLCh>
>
> is not legal C++. Nor does it work in any recent g++ version, because they
> chose strict compliance over continuing to let this work.

Technically speaking, it is legal C++, but it's a bit more involved than
this.  You also have to define type traits for XMLCh and then deal with
the fact that your XMLCh strings won't work with char or wchar_t strings,
can't be printed via cout or wcout, etc.  Personally, I'd much rather have
Xerces generate native wchar_t strings on whatever platform it's built on,
but this is obviously non-trivial.

> It's not a simple
> trade-off, but it's a serious bitch to work around, since it makes it really
> hard to do efficient STL programming.

Eh, all that's required is another transcoding jump from XMLCh* to
wstring in the XML code wrappers.  Irritating and slow, but not a major
complication.


Sean

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to