Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   XML (http://www.velocityreviews.com/forums/f32-xml.html)
-   -   Determine encoding of XML file with xerces-c and SAXParser (http://www.velocityreviews.com/forums/t392759-determine-encoding-of-xml-file-with-xerces-c-and-saxparser.html)

christian.eickhoff@nt.uni-saarland.de 01-24-2007 04:23 PM

Determine encoding of XML file with xerces-c and SAXParser
 
Hello Everyone,

I am facing a problem which should be relatively easy to solve for XML
or XERCES experts. I am parsing my XML instance using xerces-c
SAXParser. For internal purposes, it is essential to determine the
charset encoding which is usually indentified within the header of the
XML file e.g. <?xml version="1.0" encoding="UTF-8" ?>
After a query in the xerces-c API documentation I guess that:

- XMLDecl(const XMLCh *const versionStr, const XMLCh *const
encodingStr, const XMLCh *const standaloneStr, const XMLCh *const
actualEncodingStr)

should be the right method to detect the according encoding scheme.
After desperate tries to implement this function, I would like to ask
whether somebody has example code in c++ for me as I am almost about to
faint.. Should be very easy actually but maybe I am just not clever
enough to solve myself.. =((

Every code snippet is highly appreciated!!!!

Thanks in advance,
Chris


Magnus Henriksson 01-25-2007 09:51 AM

Re: Determine encoding of XML file with xerces-c and SAXParser
 
christian.eickhoff@nt.uni-saarland.de wrote:
> Hello Everyone,
>
> I am facing a problem which should be relatively easy to solve for XML
> or XERCES experts. I am parsing my XML instance using xerces-c
> SAXParser. For internal purposes, it is essential to determine the
> charset encoding which is usually indentified within the header of the
> XML file e.g. <?xml version="1.0" encoding="UTF-8" ?>


getEncoding()




// Magnus

Magnus Henriksson 01-25-2007 10:01 AM

Re: Determine encoding of XML file with xerces-c and SAXParser
 
Magnus Henriksson wrote:
> christian.eickhoff@nt.uni-saarland.de wrote:
>> Hello Everyone,
>>
>> I am facing a problem which should be relatively easy to solve for XML
>> or XERCES experts. I am parsing my XML instance using xerces-c
>> SAXParser. For internal purposes, it is essential to determine the
>> charset encoding which is usually indentified within the header of the
>> XML file e.g. <?xml version="1.0" encoding="UTF-8" ?>

>
> getEncoding()
>


Sorry, upon further inspection it turns out that this does not work the
same as it does in Java (which I assumed). Can't help you...


// Magnus


All times are GMT. The time now is 09:44 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57