[Expat-discuss] Re: ASCII "unknown encoding" [WAS: iso-8859-1 "unknown encoding" ?]

Alexander Indenbaum alexander.indenbaum at gmail.com
Mon Feb 7 12:50:30 CET 2005


Karl,

Passing explicit "US-ASCII" encoding to XML_ParserCreate() as you
suggested did the trick. I should have RTFMed more :{).

Many thanks,
  Alexander Indenbaum


On Sun, 06 Feb 2005 11:48:01 -0500, Karl Waclawek <karl at waclawek.net> wrote:
> 
> 
> Alexander Indenbaum wrote:
> > Hello,
> >
> > I re-checked and it looks I dis-informed you.  The declared  encoding
> > was "ASCII" and not "iso-8859-1".
> >
> > <rant>
> > According to IANA ( http://www.iana.org/assignments/character-sets )
> > ASCII is a valid alias to ANSI_X3.4-1968, yet it still returns error
> > 18 ( unknown encoding ).
> > </rant>
> 
> According to the docs, Expat unserstands the name US-ASCII, which is
> also the preferred name used by IANA. Expat does not try to understand
> all IANA aliases for a specific encoding. Also, technically speaking,
> US-ASCII is a subset of UTF-8 and therefore you don't even need
> an encoding declaration.
> 
> In your case, if the document is declared as "ASCII" and you can't
> change that, just force Expat to treat it as "US-ASCII".
> This is done by passing an encoding name to XML_ParserCreate.
> 
> Karl
>


More information about the Expat-discuss mailing list