Steven T. Hatton wrote:
On Wednesday 08 March 2006 03:30, Lumir Vanek wrote:
Hi,

in KXMLEditor we have helper class for QString - XMLCh* conversion, look
at:

http://cvs.sourceforge.net/viewcvs.py/kxmleditor/kxmleditor/part/kxestring.
h?rev=1.7&view=markup

A am not sure, if this approach is absolutely right, but it works for me.

It looks as though the ucs2() has been depracated in favor of utf16 in Qt4. What I've been trying to figure out is what it means that Xerces C++ and Linux wchar_t don't get along well.

What does this simply program output on your system and compiler?

#include <stddef.h>
#include <iostream>
#include <xercesc/util/XMLUniDefs.hpp>

int
main()
{
    if (sizeof(XMLCh) == sizeof(wchar_t))
    {
        std::cout << "Congratulations, wchar_t is a 16-bit integral.\n";
    }
    else
    {
        std::cout << "Sorry, wchar_t is not a 16-bit integral.\n";
    }

    return 0;
}

On my Fedora Core 4 system, with GCC 4.0.0, I get:

    Sorry, wchar_t is not a 16-bit integral.

I'm not sure anyone has ever said that Xerces-C and Linux wchar_t "don't get along." The problem is that Xerces-C encodes string data in UTF-16 internally, and using wchar_t to hold UTF-16 code points is not portable.

Dave

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

Reply via email to