You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Lars Buitinck <la...@gmail.com> on 2011/01/17 16:24:06 UTC

Which byte-order does XMLCh use?

Hello,

I'm using XQilla and Xerces-C++ in a Qt-based app, and I need to
"convert" a QString to an XMLCh *. I can get a NUL-terminated unsigned
short * storing UTF-16 in native byte order from Qt, but I wasn't sure
what byte order Xerces-C++ expects its XMLCh's to be in. If they are
also supposed to be host byte-order, I could just pass the pointer
without any conversion.

Sorry if this has been asked before, I couldn't find it on the web.

Regards,
Lars Buitinck

Re: Which byte-order does XMLCh use?

Posted by John Snelson <jo...@snelson.org.uk>.
Hi Lars,

Xerces-C uses host byte order, so you should be fine passing in the 
pointer from the QString.

John

On 17/01/11 15:24, Lars Buitinck wrote:
> Hello,
>
> I'm using XQilla and Xerces-C++ in a Qt-based app, and I need to
> "convert" a QString to an XMLCh *. I can get a NUL-terminated unsigned
> short * storing UTF-16 in native byte order from Qt, but I wasn't sure
> what byte order Xerces-C++ expects its XMLCh's to be in. If they are
> also supposed to be host byte-order, I could just pass the pointer
> without any conversion.
>
> Sorry if this has been asked before, I couldn't find it on the web.
>
> Regards,
> Lars Buitinck