[Expat-discuss] Encoding

Lin Shen lshen@cisco.com
Tue Apr 16 12:36:16 2002


Fred,

Maybe I didn't state it clear in my last mail. What I'm looking for is a way
to get the encoding pesudo-attribute of the XML declaration. I'm not sure
which callback handler suits this case. I'm using element handler in my
applicaiton right now, but it skips <?xml ?>. And I also tried the default
handler, it passes everything (including comments) back to the application,
which meaks me wonder if there is a better way.

thanks
lin

----- Original Message -----
From: "Fred L. Drake, Jr." <fdrake@acm.org>
To: "Lin Shen" <lshen@cisco.com>
Cc: <expat-discuss@lists.sourceforge.net>
Sent: Tuesday, April 16, 2002 12:11 PM
Subject: Re: [Expat-discuss] Encoding


>
> Lin Shen writes:
>  > I'm using Expat to parse my VoiceXML document. Just wonder which
>  > API should I use to get the encoding specified in the document by
>  > <?xml version="1.0" encoding="UTF-8"?> in my application? I'm using
>  > Expat 1.1.
>
> If the actual encoding and the encoding pseudo-attribute of the XML
> declaration, then you don't need to do anything; just pass NULL as the
> first parameter to XML_ParserCreate() or XML_ParserCreateNS().  If you
> know the actual encoding, pass it as a string to one of those
> functions.
>
>
>   -Fred
>
> --
> Fred L. Drake, Jr.  <fdrake at acm.org>
> PythonLabs at Zope Corporation