Re: Encoding support in SAX-like interface

[email protected] (Jirka Kosek) Thu, 23 Sep 2004 14:00:07 +0200
Newsgroups php.xml.dev
Message-ID <[email protected]>
Jirka Kosek wrote:

> I know that in PHP4 and older xml_parser used expat parser as an 
> underlying implementation and was limited to characters in ISO-8859-1. 
> According to documentation in PHP5 xml_parser should be built on the top 
> of libxml2. Thus I thought that it would support all encodings supported 
> by libxml2. My experience is that characters outside of ISO-8859-1 are 
> replaced by ? in the same way as expat does it.

Never mind. I figured out that layering on top of libxml2 is little 
non-intuitive, but if I specify optional parameter on 
xml_parser_create() I can read document in whatever encoding supported 
by libxml2 and this encoding is internally converted into utf-8.

$parser = xml_parser_create("utf-8");

-- 
------------------------------------------------------------------
   Jirka Kosek     e-mail: [email protected]     http://www.kosek.cz
------------------------------------------------------------------
   Profesionální školení a poradenství v oblasti technologií XML.
      Podívejte se na náš nově spuštěný web http://DocBook.cz
------------------------------------------------------------------