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 Olumide <50...@web.de> on 2016/11/04 15:02:10 UTC

Does xerces-c have a default encoding and can it be modified?

Dear List,

Does xerces-c decode all characters to a default encoding? And if so can 
this default encoding be user-specified.

While parsing a UTF-8 encoded XML the the data callback

DefaultHandler::characters( const XMLCh *const chars, const XMLSize_t 
length )

the data stored by the "chars" argument is no longer in UTF-8. For 
example the pound symbol, 0xC2 0xA3 in UTF appears as 0x00 0xA3. This 
leads me to conclude that xerces-c is decoding the string whereas I'd 
like it not to. I would like to handle the decoding myself.

Regards,

- Olumide

Re: Does xerces-c have a default encoding and can it be modified?

Posted by Olumide <50...@web.de>.
Found the answer.

InputSource::setEncoding(const XMLCh* const encodingStr)


- Olumide

On 04/11/2016 15:02, Olumide wrote:
> Dear List,
>
> Does xerces-c decode all characters to a default encoding? And if so can
> this default encoding be user-specified.
>
> While parsing a UTF-8 encoded XML the the data callback
>
> DefaultHandler::characters( const XMLCh *const chars, const XMLSize_t
> length )
>
> the data stored by the "chars" argument is no longer in UTF-8. For
> example the pound symbol, 0xC2 0xA3 in UTF appears as 0x00 0xA3. This
> leads me to conclude that xerces-c is decoding the string whereas I'd
> like it not to. I would like to handle the decoding myself.
>
> Regards,
>
> - Olumide