Hi exits,

        I know it's ugly but I have doing this: (short is two bytes)

#ifdef _WIN32
//windows uses UTF-16 and xerces does the same,
//so this is quite simple
const wchar_t *buf = a.rawBuffer();
#else
//gcc uses something else.
//a wchar_t is a long int there

const unsigned short * buf = a.rawBuffer();
char * buf_copy = new char[a.length() + 1];
unsigned int a_length;
for (a_length = 0; a_length < a.length(); a_length++)
{
if (*(buf + a_length) > 127 )
throw udm_exception("Non ASCII characters are not supported on this platform!");
*(buf_copy + a_length) = *(buf + a_length);
};
*(buf_copy + a_length) = '\0';


#endif



Endre


On Mon, 17 Jan 2005 13:48:27 -0800 (PST), exits funnel <[EMAIL PROTECTED]> wrote:


Hello,

I'm in the process of porting a windows app which uses
xerces-c 2.5.0 (SAX) to Linux (g++).  The application
uses wchar_t internally for all it's string
manipulation including it's interactions with the
xerces sax parser.  I'm getting compiler errors on
linux.  If I understand the situation correctly, this
is because XMLChar is two bytes on all platforms which
matches wchar_t on Windows but not on Linux on which
wchar_t is four bytes.

Maybe this isn't strictly speaking a xerces question
but I figure the people on this list must have
experience with the issue.  I'd like to leave as much
of the code using wchar_t as possible, and only make
changes when required to interact with xerces.  For
example, in ContentHandler::characters( ), I'd like to
copy the XMLCh* data returned, to wchar_t on both
platforms.  Will XMLString::transcode( ) do what I
want?  I'm a little confused.  Thanks for any guidance
anyone can offer.

-exits

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

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



-- Endre Magyari Manager Executiv Internet Data Telefonie Nextra Telecom Membra a Grupului Astral Miercurea-Ciuc Tel: 0266 317500, 0366 100100 Fax: 0266 317515 www.nextra.ro/ntc

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



Reply via email to